404 Error When Accessing Sample App in AWS EKS Cluster with ACM Cert and Traefik
Hello,
I am testing Traefik in an AWS EKS cluster using an ACM certificate ARN for HTTPS. The Traefik dashboard is accessible and functioning as expected, with correct routers and services displayed. However, when deploying a sample app (whoami
), I am encountering a 404
error when accessing the app.
Below are the manifests I am using to deploy the whoami
app:
Deployment (whoami.yaml
)
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
namespace: traefik-app-server
spec:
replicas: 1
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami
Service (whoami-service.yaml
)
apiVersion: v1
kind: Service
metadata:
name: whoami
namespace: traefik-app-server
spec:
ports:
- name: http
targetPort: 80
port: 80
selector:
app: whoami
Ingress (ingress.yaml
)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: whoami
namespace: traefik-app-server
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
rules:
- host: traefik-testapp.xxxxx.com
http:
paths:
- path: /whoami
pathType: Prefix
backend:
service:
name: whoami
port:
number: 80
When trying to access the app at https://traefik-testapp.xxxxx.com/whoami
, I receive the following log in Traefik and a 404
response:
traefik-fc7f9c975-5dh5h 172.17.21.181 - - [07/Jan/2025:14:56:39 +0000] "GET /whoami HTTP/1.1" 404 19 "-" "-" 2 "-" "-" 0ms
- Verified that the ACM certificate is correctly attached to the
websecure
entrypoint. - Confirmed that the Traefik dashboard is visible, with no issues regarding routers or services.
- Checked the
whoami
deployment and service, both of which appear to be running correctly.
- Is there a misconfiguration in my
Ingress
orService
resources? - Could this be an issue with routing the
/whoami
path to the service, or perhaps with the TLS configuration? - Are there any additional logs or configurations I should check to identify the cause of the
404
?
Any insights or suggestions would be greatly appreciated!