Can't create by example

Hello,

I am newbie of Kong.

I following this guideline: https://konghq.com/blog/kubernetes-ingress-controller-for-kong/, when I creating the following Ingress,

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: foo-bar
spec:
rules:

  • host: foo.bar
    http:
    paths:
  • path: /
    backend:
    serviceName: http-svc
    servicePort: 80

It showing below error:

error: error validating “kong-ingress.yaml”: error validating data: [ValidationError(Ingress): unknown field “name” in io.k8s.api.extensions.v1beta1.Ingress, ValidationError(Ingress): unknown field “paths” in io.k8s.api.extensions.v1beta1.Ingress, ValidationError(Ingress): unknown field “rules” in io.k8s.api.extensions.v1beta1.Ingress, ValidationError(Ingress): unknown field “serviceName” in io.k8s.api.extensions.v1beta1.Ingress, ValidationError(Ingress): unknown field “servicePort” in io.k8s.api.extensions.v1beta1.Ingress]; if you choose to ignore these errors, turn validation off with --validate=false
[root@sealos01 yaml]# vi kong-ingress.yaml

Thanks for help.

I forgot show you namespace, pod and svc:

[root@sealos01 yaml]# kubectl get namespace
NAME STATUS AGE
default Active 3d1h
kong Active 17m
kube-node-lease Active 3d1h
kube-public Active 3d1h
kube-system Active 3d1h

[root@sealos01 yaml]# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
helloworld-v1 NodePort 10.106.142.245 80:30303/TCP 42h
helloworld-v2 NodePort 10.104.122.162 80:30304/TCP 42h
http-svc NodePort 10.110.174.39 80:30276/TCP 16m
kubernetes ClusterIP 10.96.0.1 443/TCP 3d1h

[root@sealos01 yaml]# kubectl get pods
NAME READY STATUS RESTARTS AGE
http-svc-5ddf557c77-m8rbp 1/1 Running 0 17m
nodehelloworld.example1.com 1/1 Running 0 42h
nodehelloworld.example2.com 1/1 Running 0 42h

Can someone help? thanks.

Can you post your YAML inside a code snippet?
The formatting is all messed up and we can’t help you out.
I’d recommend to follow this guide instead: https://bit.ly/k4k8s-get-started

Hello hbagdi,

The ingress yaml file no problem now, but no external IP address:

[root@sealos01 yaml]# kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
foo-bar foo.bar 80 13s

Thanks