<p>I'm preparing all the Ingress manifest files to keep the latest apiVersion (<strong>networking.k8s.io/v1</strong>) to upgrade my cluster from 1.19 to 1.22.</p>
<p>I'm deleting the previous Ingress rule and then recreating:</p>
<pre><code>k delete ingress/my-ingress
k create -f /tmp/ingress.yaml
</code></pre>
<p>Unfortunately, the Ingress is created but with apiVersion <strong>extensions/v1beta1</strong> that's different for what I have on my manifest:</p>
<pre class="lang-yaml prettyprint-override"><code>$ k get ingress/my-ingress -o yaml
Warning: extensions/v1beta1 Ingress is deprecated in v1.14+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/ssl-passthrough: &quot;true&quot;
  creationTimestamp: &quot;2021-08-11T19:42:08Z&quot;
</code></pre>
<p>Here is an example of the YAML I'm using:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/ssl-passthrough: &quot;true&quot;
  labels:
    app.kubernetes.io/instance: my-app
    app.kubernetes.io/name: my-app
  name: my-ingress
  namespace: default
spec:
  rules:
  - host: application.com
    http:
      paths:
        - path: /
          pathType: ImplementationSpecific
          backend:
            service:
              name: my-app
              port:
                number: 443
</code></pre>
<p>Kubernetes version:</p>
<pre><code>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;20&quot;, GitVersion:&quot;v1.20.1&quot;, GitCommit:&quot;c4d752765b3bbac2237bf87cf0b1c2e307844666&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-12-18T12:09:25Z&quot;, GoVersion:&quot;go1.15.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;19+&quot;, GitVersion:&quot;v1.19.13-eks-8df270&quot;, GitCommit:&quot;8df2700a72a2598fa3a67c05126fa158fd839620&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2021-07-31T01:36:57Z&quot;, GoVersion:&quot;go1.15.14&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>Ingress controller version (I upgraded from 0.41 to avoid any kind of issues):</p>
<pre><code>Image: k8s.gcr.io/ingress-nginx/controller:v0.48.1@sha256:e9fb216ace49dfa4a5983b183067e97496e7a8b307d2093f4278cd550c303899
</code></pre>

<p><a href="https://github.com/kubernetes/kubernetes/issues/94761" rel="nofollow noreferrer">This is working as expected</a>, in particular check <a href="https://github.com/kubernetes/kubernetes/issues/94761#issuecomment-691982480" rel="nofollow noreferrer">github answer</a></p>
<p>When you create an ingress object, it can be read via any version - the server handles converting into the requested version.
In your request <code>get ingress/my-ingress -o yaml</code> you not specified version, which should be read. In such case kubectl searches documents returned by the server to find the first among them with requested resource. And it can be any version, as in your case.</p>
<p>That is why, if you want to check particular version, you can:</p>
<ol>
<li>Improve your request with adding your manifest file, since version specified in the file</li>
</ol>
<pre><code>    $ kubectl get -f ingress.yaml -o yaml                                                                                                                
    apiVersion: networking.k8s.io/v1
    kind: Ingress
    metadata:
      annotations:
        ...
</code></pre>
<ol start="2">
<li>Other option is to qualify necessary version in get request:</li>
</ol>
<pre><code>    $ kubectl get ingresses.v1.networking.k8s.io
    NAME         CLASS    HOSTS             ADDRESS   PORTS   AGE
    my-ingress   &lt;none&gt;   application.com             80      12m

    $ kubectl get ingresses.v1beta1.networking.k8s.io
    Warning: networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
    NAME         CLASS    HOSTS             ADDRESS   PORTS   AGE
    my-ingress   &lt;none&gt;   application.com             80      13m
</code></pre>
