I have a fresh
k3s installation with default Traefik (v1) disabled. I installed Traefik v2.2.8 using the Helm chart. I then enabled the dashboard with an IngressRoute, I can access it and all works well.
I then created the following
kind: Deployment apiVersion: apps/v1 metadata: name: whoami-app spec: replicas: 1 selector: matchLabels: app: whoami-app template: metadata: labels: app: whoami-app spec: containers: - name: whoami-app image: containous/whoami ports: - containerPort: 80 --- kind: Service apiVersion: v1 metadata: name: whoami-app labels: app: whoami-app spec: ports: - port: 80 name: whoami-app selector: app: whoami-app --- kind: IngressRoute apiVersion: traefik.containo.us/v1alpha1 metadata: name: whoami-app spec: entryPoints: - web routes: - match: Host(`whoami.apps.lh`) kind: Rule services: - name: whoami-app port: 80
When run, everything seems ok. The pod is created and I can see the rule under Routers and the service under Services in the Traefik dashboard. When I access the Cluster IP provided by
kubectl get service I get the expected response. When, however, I access the URL of the defined host (in this case
whoami.apps.lh I get a Bad Gateway message. I tried with another service running apache and I get the same exact behavior. I do add the URL to the
/etc/hosts file, otherwise the server is not found (kind of obvious).
The container is running and the logs indicate that the request is never forwarded to the container.
I'm on Fedora 32. Fairly new to Traefik so any help on troubleshooting would be appreciated.