404 with traefik ingress controller using NodePort service type

I have configured traefik as my ingress controller for my k8s cluster on Digital Ocean. I am using terraform + helm to set up the entire cluster + traefik ingress controller + cert-manager. Everything is working as expected.

However, now I want to use an existing DO load balancer for my traefik ingress controller instead of the LB that automatically gets created by Digital Ocean when creating the LoadBalancer type k8s service for the traefik ingress controller.

In the traefik helm chart I’ve set the service.type to NodePort and the node ports to 30080 and 30443.

When I point my Digital Ocean load balancer to the nodes on ports 30080 and 30443, I get a 404 error from traefik. So, it does reach the traefik ingress controller but it does not seem to be able to route the request to the correct service.

My Ingress resource looks like this:

resource "kubernetes_ingress_v1" "whoami" {
  metadata {
    name = "whoami"

    annotations = {
      "" : "websecure"
      "" : "true"
      "" : "letsencrypt-issuer"

  spec {
    rule {
      host = ""

      http {
        path {
          path = "/foo"
          path_type = "Prefix"

          backend {
            service {
              name = "whoami"

              port {
                number = 80

    tls {
      secret_name = ""
      hosts = [

If I use the LoadBalancer type service for traefik, everything works as expected through the automatically provisioned LB and I can access the whoami service via Does anyone know what I am doing wrong or what I am missing?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer