<p>We are using the networking.k8s.io/v1beta1 and we trying to move to networking.k8s.io/v1 with the following changes and my ingress.YAML code looks like this now.</p>
<p>Version:&quot;v1.20.15-gke.2500&quot;</p>
<p>When I applied the &quot;kubectl apply&quot; I got to see the following error, could someone help me why I am facing this error?</p>
<pre><code>error: error validating &quot;ingress.yaml&quot;: error validating data: [ValidationError(Ingress.spec.rules[0].http.paths[0].backend.service.port): invalid type for io.k8s.api.networking.v1.ServiceBackendPort: got &quot;integer&quot;, expected &quot;map&quot;, ValidationError(Ingress.spec.rules[0].http.paths[1].backend.service.port): invalid type for io.k8s.api.networking.v1.ServiceBackendPort: got &quot;integer&quot;, expected &quot;map&quot;, ValidationError(Ingress.spec.rules[0].http.paths[2].backend.service.port): invalid type for io.k8s.api.networking.v1.ServiceBackendPort: got &quot;integer&quot;, expected &quot;map&quot;; if you choose to ignore these errors, turn validation off with --validate=false
</code></pre>
<hr />
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ***
  annotations:
    kubernetes.io/ingress.global-static-ip-name: ****
    networking.gke.io/managed-certificates: *****
spec:
  rules:
    - host: ***
      http:
        paths:
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                 name: *********
                 port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                  name: *********
                  port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                 name: *********
                 port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                 name: *********
                 port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                 name: *********
                 port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                  name: *********
                  port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                  name: *********
                  port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                  name: *********
                  port: 50000
    - host: *********
      http:
        paths:
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                  name: *********
                  port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                 service:
                   name: *********
                   port: 50000
          - path: /****/*
            pathType: Prefix
            backend:
                service:
                  name: *********
                  port: 50000
</code></pre>

Yuva Yuva
<p>You are using the Old format of YAML with API <strong>networking.k8s.io/v1</strong> it's updated now.</p>
<p>You can read more here : <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource</a></p>
<p>Change in service port</p>
<pre><code>            backend:
              service:
                name: test
                port:
                  number: 80
</code></pre>
<p>Ref YAML block :</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
spec:
  ingressClassName: class-name
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80
</code></pre>
