Is anyone able to help explain why this yaml: ``` apiVersion: <http://networkin . . .

Dave McLean:
Is anyone able to help explain why this yaml:

apiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: Ingress
metadata:
  name: ingress
  annotations:
    <http://nginx.ingress.kubernetes.io/rewrite-target|nginx.ingress.kubernetes.io/rewrite-target>: /
spec:
  rules:
  - http:
      paths:                 &lt;--- 4 paces here?!
      - path: /wear
        pathType: Prefix
        backend:
          service:
            name: video-service
            port:
              number: 8080

is valid.

but this yaml:

apiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: Ingress
metadata:
  name: ingress
  annotations:
    <http://nginx.ingress.kubernetes.io/rewrite-target|nginx.ingress.kubernetes.io/rewrite-target>: /
spec:
  rules:
  - http:
    paths:               &lt;--- 2 paces here?!
    - path: /wear
      pathType: Prefix
      backend:
        service:
          name: video-service
          port:
            number: 8080

is not?

This only difference is that in the first “paths” and everything under it is double indented.

The failure is:

error validating data: ValidationError(Ingress.spec.rules[0]): unknown field “paths” in io.k8s.api.networking.v1.IngressRule;

Ashok Kumar:
This is because path object comes inside http and not on the same level while paths have array of objects


Dave McLean:
Ah thanks - I stared at this for AGES not seeing it.