Do I have to define an ingress per service with Linkerd? Do I have to define an ingress per service with Linkerd? kubernetes kubernetes

Do I have to define an ingress per service with Linkerd?


Yes, unfortunately you understood correctly about creating separate ingress for each service if you want use ingress.kubernetes.io/custom-request-headers.Yes, if you would have 1000 services - you should create 1000 ingresses to make it work properly.

Ingress1:

apiVersion: extensions/v1beta1kind: Ingressmetadata:  name: web-ingress  namespace: marcus  annotations:    kubernetes.io/ingress.class: "traefik"    ingress.kubernetes.io/custom-request-headers: l5d-dst-override:service1.marcus.svc.cluster.local:80spec:  rules:  - host: example.com    http:      paths:      - backend:          serviceName: service1          servicePort: 80        path: /

Ingress2:

apiVersion: extensions/v1beta1kind: Ingressmetadata:  name: web-ingress  namespace: marcus  annotations:    kubernetes.io/ingress.class: "traefik"    ingress.kubernetes.io/custom-request-headers: l5d-dst-override:service2.marcus.svc.cluster.local:80spec:  rules:  - host: example.com    http:      paths:      - backend:          serviceName: service2          servicePort: 80        path: /


Traefik is a great solution, and in this case it would be great if it had the option to dynamically set the service in a header.

There is an open issue on this in the traefik project that has been open for a while. The last update is to use an Ingress per service in these scenarios.

Here's similar question.