I have deployed a nginx ingress in my baremetal k8s cluster - using metallb. Previously I did it with the
apiVersion: networking.k8s.io/v1beta1
tag and it worked fine. However, that tag is no longer supported so I'm using
apiVersion: networking.k8s.io/v1
I have 2 frontends both in react and several backends like 7 of them.
I have 2 issues:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web1-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
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: "nginx"
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web2-service
port:
number: 5000
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?
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-map
annotations:
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /styles/*
pathType: Exact
backend:
service:
name: map-service
port:
number: 7000
ingressClassName: nginx
Is there something with the order?