<p>I'm running into an issue where our nginx-ingress is no longer working properly. We had an issue where one of the worker nodes went down and it ended up evicting a number of ingress pods. We created a new worker node and the pods were recreated with no errors.
The error I was getting was the following when I inspected the logs for the nginx-ingress pods:</p>
<pre><code>W0731 18:11:20.640729       1 warnings.go:70] networking.k8s.io/v1beta1 Ingress is deprecated in v1.19+, unavailable in v1.22+; use networking.k8s.io/v1 Ingress
E0731 18:11:26.533749       1 reflector.go:138] /home/runner/work/kubernetes-ingress/kubernetes-ingress/internal/k8s/controller.go:574: Failed to watch *v1.Policy: failed to list *v1.Policy: the server could not find the requested resource (get policies.k8s.nginx.org)
E0731 18:11:31.778992       1 reflector.go:138] /home/runner/work/kubernetes-ingress/kubernetes-ingress/internal/k8s/controller.go:571: Failed to watch *v1.VirtualServer: failed to list *v1.VirtualServer: the server could not find the requested resource (get virtualservers.k8s.nginx.org)
E0731 18:11:51.190680       1 reflector.go:138] /home/runner/work/kubernetes-ingress/kubernetes-ingress/internal/k8s/controller.go:572: Failed to watch *v1.VirtualServerRoute: failed to list *v1.VirtualServerRoute: the server could not find the requested resource (get virtualserverroutes.k8s.nginx.org)
E0731 18:11:59.259723       1 reflector.go:138] /home/runner/work/kubernetes-ingress/kubernetes-ingress/internal/k8s/controller.go:574: Failed to watch *v1.Policy: failed to list *v1.Policy: the server could not find the requested resource (get policies.k8s.nginx.org)
E0731 18:12:11.070691       1 reflector.go:138] /home/runner/work/kubernetes-ingress/kubernetes-ingress/internal/k8s/controller.go:573: Failed to watch *v1alpha1.TransportServer: failed to list *v1alpha1.TransportServer: the server could not find the requested resource (get transportservers.k8s.nginx.org)
E0731 18:12:26.943999       1 reflector.go:138] /home/runner/work/kubernetes-ingress/kubernetes-ingress/internal/k8s/controller.go:571: Failed to watch *v1.VirtualServer: failed to list *v1.VirtualServer: the server could not find the requested resource (get virtualservers.k8s.nginx.org)
</code></pre>
<p>Our current ingress looks something like this:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dev-ingress
  namespace: dev-namespace
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/affinity: &quot;cookie&quot;
    nginx.ingress.kubernetes.io/session-cookie-name: &quot;route&quot;
    nginx.ingress.kubernetes.io/session-cookie-expires: &quot;172800&quot;
    nginx.ingress.kubernetes.io/session-cookie-max-age: &quot;172800&quot;
    nginx.ingress.kubernetes.io/proxy-body-size: &quot;0&quot;
    nginx.ingress.kubernetes.io/proxy-read-timeout: &quot;900&quot;
    nginx.ingress.kubernetes.io/proxy-send-timeout: &quot;900&quot;
    nginx.ingress.kubernetes.io/proxy-buffer-size: &quot;256k&quot;
    nginx.ingress.kubernetes.io/proxy-buffers: &quot;4 256k&quot;
    nginx.ingress.kubernetes.io/server-snippet: client_header_buffer_size 256k
    nginx.ingress.kubernetes.io/server-snippet: large_client_header_buffers 4 256k;
    nginx.org/websocket-services: &quot;contoso-service,sbase-service&quot;
    nginx.ingress.kubernetes.io/configuration-snippet: |
        proxy_http_version 1.1;
        proxy_set_header Upgrade &quot;websocket&quot;;
        proxy_set_header Connection &quot;Upgrade&quot;;
spec:
  tls:
  - secretName: tls2023
    hosts:
      - sbasedev.net
      - contosodev.net
  rules:
  - host: sbasedev.net
    http:
      paths:
      - backend:
          serviceName: sbase-service
          servicePort: 80
 
</code></pre>
<p>For context, the kubernetes version we are running is v1.12.0. When I checked the nginx version inside the pods, the version running is 1.19.6.</p>
<p>I tried deleting and recreating the pods however the same error occured. This configuration was confirmed working until the nginx pods were evicted and recreated.</p>

Derek Chen
<p>Upon checking the error messages, It seems like your Ingress resources are using deprecated API version <a href="http://networking.k8s.io/v1beta1" rel="nofollow noreferrer">networking.k8s.io/v1beta1</a> which was deprecated in v 1.19 and the Ingress Controller is unable to find CRD’s that are needed. You should update your ingress resources to use the <a href="http://networking.k8s.io/v1" rel="nofollow noreferrer">networking.k8s.io/v1</a> API version and install the missing CRD’s. Here are documentations that can be helpful in your use case. [1][2][3]</p>
<p>[1] <a href="https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/" rel="nofollow noreferrer">https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/</a></p>
<p>[2] <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/kubectl/cheatsheet/</a></p>
<p>[3] <a href="https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/" rel="nofollow noreferrer">https://docs.nginx.com/nginx-ingress-controller/installation/installation-with-manifests/</a></p>
