Search code examples
kuberneteskubernetes-helmkubernetes-ingresstraefiktraefik-ingress

Upgraded Traefik and now K8s Ingress Controller isn't working


I had previously installed Traefik 2 via Helm on my K8s cluster at home. I don't remember the specific version but I know it was some version of Traefik 2. My cluster is actually several Raspberry Pis where I installed Kubernetes with K3s. For many months it had been working great. When I created Services with Ingress objects, Traefik would detect this and act like a load balancer, exposing the service to a specific host name.

Today I ran a job that was apparently a little too resource intensive because it evicted the Traefik pods for OOM errors. Even after killing the large job, the Traefik pods didn't come back up on their own, so I uninstalled Traefik (via helm uninstall) and then used Helm to install the latest version (2.9.10). In particular I used the following command to install it (where I substitued 1.2.3.4 with my real IP):

helm upgrade --install traefik --set dashboard.enabled=true --set rbac.enabled=true --set="service.externalIPs={1.2.3.4}" --set="additionalArguments={--api=true,--log.level=INFO,--providers.kubernetesingress.ingressclass=traefik-internal,--serversTransport.insecureSkipVerify=true}" traefik/traefik

However, although Traefik is now running without any obvious errors, the Ingress Controller functionality doesn't seem to work. When I look at the Traefik dashboard under Services, I see api@internal, dashboard@internal, noop@internal, ping@internal, and prometheus@internal... but nothing else. Previously I saw services listed there on the dashboard to correspond to each Ingress object I had defined. I can post the full YAML of any of my Ingress objects if desired, but suffice it to say that all of them have the kubernetes.io/ingress.class: traefik annotation defined.

Has something changed with the most recent version of Traefik? The helm upgrade --install command that I used is identical to the one I used many months ago. But like I said, this time around the Ingress Controller functionality no longer seems to work.


Solution

  • It "doesn't work" because you provided in your additional arg --providers.kubernetesingress.ingressclass=traefik-internal in your helm install command and traefik docs for this argument says that with this arg specified, only Ingress object with annotation kubernetes.io/ingress.class: traefik-internal will be processed.

    However, your Ingress objects' annotation is kubernetes.io/ingress.class: traefik -- that's why it "no longer works".

    To resolve this, you can run the helm upgrade command you ran with adjusted args:

    helm upgrade --install traefik --set dashboard.enabled=true --set rbac.enabled=true --set="service.externalIPs={1.2.3.4}" --set="additionalArguments={--api=true,--log.level=INFO,--serversTransport.insecureSkipVerify=true}" traefik/traefik

    This will make traefik process all Ingress objects without the annotation, having an empty value, or the value traefik

    If you wanna be restrictive, then

    helm upgrade --install traefik --set dashboard.enabled=true --set rbac.enabled=true --set="service.externalIPs={1.2.3.4}" --set="additionalArguments={--api=true,--log.level=INFO,--providers.kubernetesingress.ingressclass=traefik,--serversTransport.insecureSkipVerify=true}" traefik/traefik