<p>Wanted your guidance on an issue while executing a Kubernetes YAML file.
My kubectl version is as follows:</p>
<pre><code>    Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.0&quot;, GitCommit:&quot;af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-12-08T17:59:43Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;windows/amd64&quot;}
    Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;18&quot;, GitVersion:&quot;v1.18.14&quot;, GitCommit:&quot;89182bdd065fbcaffefec691908a739d161efc03&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-12-18T12:02:35Z&quot;, GoVersion:&quot;go1.13.15&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>This is the latest version downloaded from the Kubernetes site
<a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows" rel="noreferrer">https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-windows</a></p>
<p>The YAML has
apiVersion: networking.k8s.io/v1
kind: Ingress
and the error on running the YAML is</p>
<pre><code>    no matches for kind &quot;Ingress&quot; in version &quot;networking.k8s.io/v1&quot;
</code></pre>
<p>Kubernetes issue <a href="https://github.com/kubernetes/kubernetes/issues/90077" rel="noreferrer">https://github.com/kubernetes/kubernetes/issues/90077</a> mentions that</p>
<pre><code>  networking.k8s.io/v1beta1 == 1.14 to 1.18
  networking.k8s.io/v1 = 1.19+
</code></pre>
<p>So I guess it should be working right?</p>
<p>I have changed the API Version to</p>
<pre><code>apiVersion: extensions/v1beta1 or
apiVersion: networking.k8s.io/v1beta1
</code></pre>
<p>but fail in another section of the YAML</p>
<pre><code>backend:
  service:
    name: {{ template &quot;fullname&quot; $ }}-srv
     port:
       number: 80
</code></pre>
<p>with the error</p>
<p>error validating data: ValidationError(Ingress.spec.rules[0].http.paths[0].backend): unknown field &quot;service&quot; in io.k8s.api.extensions.v1beta1.IngressBackend</p>
<p>I am informed that the same YAML works on macOS with the same kubectl version (I do not have access to verify that though). But any thoughts on where I could be going wrong?</p>
<p>Thanks,
Prabal</p>

<p>I would like to add that according to the K8 <a href="https://kubernetes.io/docs/reference/using-api/deprecation-guide/" rel="noreferrer">deprecation guide</a>, the <code>networking.k8s.io/v1beta1</code> API versions of <code>Ingress</code> is no longer served as of v1.22.</p>
<p>Changes include:</p>
<ol>
<li>The backend <code>serviceName</code> field is renamed to <code>service.name</code></li>
<li>Numeric backend <code>servicePort</code> fields are renamed to <code>service.port.number</code></li>
<li>String backend <code>servicePort</code> fields are renamed to <code>service.port.name</code></li>
<li><code>pathType</code> is now required for each specified path. Options are Prefix, Exact, and ImplementationSpecific.</li>
</ol>
<p>Meaning we need to make the following changes to go from this:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: stackoverflw
  namespace: stacker
spec:
  rules:
  - host: example.com
    http:
      paths:
      - backend:
          serviceName: stacker
          servicePort: 80
</code></pre>
<p>To this (example):</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: stackoverflw
  namespace: stacker
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: stacker
            port:
              number: 80
</code></pre>
