<p>I had installed an ran a kubernetes cluster with an nginx ingress earlier this year. Though it had little issues, it worked fine. For the ingress, I used the tag</p>
<blockquote>
<p>apiVersion: networking.k8s.io/v1beta1</p>
</blockquote>
<p>However, I have recently installed the latest version of (kubernetes 1.22) which only allows for</p>
<blockquote>
<p>apiVersion: networking.k8s.io/v1</p>
</blockquote>
<p>The problem i'm having is using my old yaml configuration with the new format.</p>
<p>My yaml file looks like this:</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: dev-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: &quot;0&quot;
    nginx.ingress.kubernetes.io/websocket-services : &quot;chatserver&quot;
    nginx.ingress.kubernetes.io/enable-cors: &quot;true&quot;
    nginx.ingress.kubernetes.io/cors-allow-methods: &quot;PUT, GET, POST, OPTIONS&quot;
    nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
spec:
  rules:
  - http:
      paths:     
      - path: /api/auth/
        pathType: Prefix
        backend:
          serviceName: um-service 
          servicePort: 5001
      - path: /api/system/*
        pathType: Prefix
        backend:
          serviceName: system-service
          servicePort: 5002
       - path: /api/news/*
        backend:
          serviceName: news-service 
          servicePort: 5003
      - path: /api/tasks/*
        # pathType: Prefix
        backend:
          serviceName: tasks-service
          servicePort: 5004
      - path: /api/chats/
        pathType: Prefix
        backend:
          serviceName: chatserver 
          servicePort: 5500
      - path: /
        backend:
          serviceName: web-service
          servicePort: 5000
</code></pre>
<p>my new manifest looks like this:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dev-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /api/auth/
        pathType: Prefix
        backend:
          service:
            name: um-service 
            port: 
              number: 5001
      - path: /api/system/*
        pathType: Prefix
        backend:
          service:
            name: system-service 
            port: 
              number: 5002
      - path: /api/chats/
        pathType: Prefix
        backend:
          service:
            name: chatserver
            port: 
              number: 5050
      - path: /
        pathType: Prefix
        backend:
          service:
            name: web-service
            port: 
              number: 5000
  ingressClassName: nginx
</code></pre>
<p>How do I convert this to use the new apiVersion: networking.k8s.io/v1 tag?</p>

Denn
<p>Fortunately there isn't too much difference between the API versions in terms of the YAML. Here's an example of <code>networking.k8s.io/v1</code> from the <a href="https://docs.k8s.io" rel="nofollow noreferrer">Kubernetes Docs</a>.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80
</code></pre>
<p>The main change for you would have to do with the how the <code>backend</code> blocks are done. For example:</p>
<pre class="lang-yaml prettyprint-override"><code>backend:
  serviceName: tasks-service
  servicePort: 5004
</code></pre>
<p>would need to become:</p>
<pre class="lang-yaml prettyprint-override"><code>backend:
  service:
    name: &quot;tasks-service&quot;
    port:
      number: 5004
</code></pre>
