<p>I have deployed a nginx ingress in my baremetal k8s cluster - using metallb. Previously I did it with the</p>
<blockquote>
<p>apiVersion: networking.k8s.io/v1beta1</p>
</blockquote>
<p>tag and it worked fine. However, that tag is no longer supported so I'm using</p>
<blockquote>
<p>apiVersion: networking.k8s.io/v1</p>
</blockquote>
<p>I have 2 frontends both in react and several backends like 7 of them.</p>
<p>I have 2 issues:</p>
<ol>
<li>How do I deploy the two react frontends with default path &quot;/&quot;
Since I need to use the react-router?
N/B They both have &quot;/&quot;, &quot;/login&quot;. &quot;/logout&quot; ... paths, It is hosted locally so no hostname..
my yaml file looks like this:</li>
</ol>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web1-ingress
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: web1-service
            port:
              number: 4000

---

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: web2-ingress
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: web2-service
            port:
              number: 5000
</code></pre>
<p>If I ran this only one will work and is very slow, perhaps because queries go to both backends or something .. How do I solve this?</p>
<ol start="2">
<li>One of my backend is a maptiler.. It does not load correctly i.e running it outside the cluster it loads the css and files properly but when adding it to the cluster, it has  <a href="https://i.stack.imgur.com/NBMCO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NBMCO.png" alt="errors" /></a>
The unexpected '&lt;' is for the  tag in the container.</li>
</ol>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-map
  annotations:
    nginx.ingress.kubernetes.io/enable-cors: &quot;true&quot;
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /styles/*
        pathType: Exact
        backend:
          service:
            name: map-service 
            port: 
              number: 7000
  ingressClassName: nginx
</code></pre>
<p>Is there something with the order?</p>

Denn
<p>check if you are using the correct syntax, I had the following error and met this same problem.
I wrote like this:</p>
<pre><code>...
    ingressClassName: nginx
    rules:
    - host: test.webapi-auth.mpbr.renola.ru
    - http:
        paths:
        - backend:
            service:
              name: service1
              port:
                number: 80
          path: /(.*)
          pathType: Prefix
...
</code></pre>
<p>but it needed to be:</p>
<pre><code>...
    ingressClassName: nginx
    rules:
    - host: test.webapi-auth.mpbr.renola.ru
      http:
        paths:
        - backend:
            service:
              name: service1
              port:
                number: 80
          path: /(.*)
          pathType: Prefix
...
</code></pre>
<p><strong>note that there should not be a &quot;-&quot; character before http</strong></p>
