Using Traefik as a Kubernetes (k3s) ingress, is it possible to return HTTP 503 Service Unavailable error instead of HTTP 404 Not Found error, when a service is unavailable?

Hi,

I'm using Traefik in my K3S kubernetes cluster. When a service exposed with an ingress is unavailable, it happens, Traefik returns 404 as it never existed. I would much rather prefer HTTP 503.

Searching did show me some old closed github issues, but I don't find how to configure traefik to do that. Is it possible?

Thanks.

Hi @fungiboletus! Thanks for your interest in Traefik!

You can use an "empty load-balancer" and allowEmptyServices.

1 Like

I set up the following HelmChartConfig but it doesn't seem to have any impact. Is there something else I must do as well ?

apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
  name: traefik
  namespace: kube-system
spec:
  valuesContent: |-
    ports:
      web:
        redirectTo: websecure
      metrics:
        hostPort: 9101
        expose: false
    service:
      spec:
        externalTrafficPolicy: Local
    providers:
      kubernetesIngress:
        allowEmptyServices: true

Hi @fungiboletus which version of the Traefik Helm chart do you use?

1 Like

Thanks! I updated K3S (stable) from 1.25.4 to 1.25.6 and the traefik helm chart went from 19 to 20.

It seems to work well now.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.