Deploying traefik on EKS with Application Load Balancer controller

525 Views Asked by At

I am trying to setup traefik on AWS EKS Cluster with Load Balancer Controller.

Here is how my helm-values.yml file looks like:

ingressClass:
  enabled: true
  isDefaultClass: true
ingressRoute:
  dashboard:
    enabled: false
service:
  enabled: true
  type: NodePort
globalArguments:
  - "--api.insecure=true"

I deploy trefik using helm chart by issuing command: helm install traefik traefik/traefik --create-namespace --namespace=traefik --values=helm-values.yaml

Next, I created dashboard.yml file to deploy the traefik dashboard. This is how the dashboard.yml file looks like:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: traefik
  name: traefik-ingress
  annotations:
    kubernetes.io/ingress.class: alb
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: instance
spec:
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: traefik
                port:
                  number: 80
---
apiVersion: v1
kind: Secret
metadata:
  name: basic-auth-creds
  namespace: traefik
type: kubernetes.io/basic-auth
stringData:
  username: test
  password: password
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: basic-auth
  namespace: traefik
spec:
  basicAuth:
    secret: basic-auth-creds
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: dashboard
  namespace: traefik
spec:
  entryPoints:
    - web
  routes:
    - match: PathPrefix(`/dashboard`, `/dashboard/`) || PathPrefix(`/api`, `/api/`)
      kind: Rule
      services:
        - name: api@internal
          kind: TraefikService
      middlewares:
        - name: basic-auth
          namespace: traefik

When I deploy dashboard.yml file, I can see a Application Load Balancer being created but the health checks fail and when I visit http://myalbdnsname/dashboard, I get 404 page not found error

What am I missing here?

1

There are 1 best solutions below

0
On

Try to add / after dashboard So it'll be http://myalbdnsname/dashboard/