Hi there,
I’ve set up multiple traefik Ingress resources for the same host, one for the path prefix /, and one for /api. They point to different services:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: a
spec:
ingressClassName: traefik
rules:
- host: "example.com"
http:
paths:
- path: /api
pathType: Prefix
backend:
service:
name: a
port:
number: 9090
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: b
spec:
ingressClassName: traefik
rules:
- host: "example.com"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: b
port:
number: 8080
When the pod behind a is running and healthy, this works as expected. However, when the pod is not healthy, requests to /api/... go to b instead.
I'm assuming this is intended behaviour but how do I make traefik return a 503 Service Unavailable response (or similar) instead?