Vasu BK:
Hi all,
I have got one more question. Sorry to post too many questions. I am seriously looking forward for you experts help.
This question is regarding ingress creation. Here is my yaml cotent.
controlplane $ cat pay-ingress.yaml
#apiVersion: extensions/v1beta1 –> Tried with this first
apiVersion: http://networking.k8s.io/v1beta1|networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: test-ingress
namespace: critical-space
annotations:
http://nginx.ingress.kubernetes.io/rewrite-target|nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:- path: /pay
backend:
serviceName: pay-service
servicePort: 8080
- path: /pay
When I try to create it, I get below warning.
controlplane $ kubectl create -f pay-ingress.yaml
Warning: extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use http://networking.k8s.io/v1|networking.k8s.io/v1 Ingress
ingress.extensions/test-ingress created
controlplane $
Then, I looked at the documentation and changed the apiVersion accordingly, as mentioned in my yaml.
Then also I get below warning when create ingress.
controlplane $ kubectl create -f pay-ingress.yaml
Warning: http://networking.k8s.io/v1beta1|networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use http://networking.k8s.io/v1|networking.k8s.io/v1 Ingress
http://ingress.networking.k8s.io/test-ingress|ingress.networking.k8s.io/test-ingress created
controlplane $
Then, I updated again apiVersion to “apiVersion: http://networking.k8s.io/v1|networking.k8s.io/v1”.
Then, it altogether fails with below error.
controlplane $ kubectl create -f pay-ingress.yaml
error: error validating “pay-ingress.yaml”: error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field “serviceName” in io.k8s.api.networking.v1.IngressBackend, ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field “servicePort” in io.k8s.api.networking.v1.IngressBackend]; if you choose to ignore these errors, turn validation off with --validate=false
controlplane $
So, can you educate me why this error though I used right apiVersion as per Warning?
Finally, I had to revert to older version, creation happens inspite of the Warning.