Hello everyone,
I’m currently trying to set up Traefik in my Kubernetes cluster using the official Helm chart. So far, the Traefik pods are reachable and respond with a 404, which is expected at this stage. However, I tried adding an application and assumed Traefik would automatically create a route for it. This does not seem to happen, and I suspect something might be wrong with the Gateway generated by the Helm chart.
Here is my installation command:
kubectl create namespace traefik
helm upgrade --install \
traefik traefik/traefik \
--namespace traefik \
--values traefik-values.yaml
Below is my traefik-values.yaml
:
# traefik-values.yaml
deployment:
replicas: 2
service:
externalIPs:
- "<MY_PUBLIC_FLOATING_IP>" # <-- placeholder for your public IP
# Let's Encrypt (ACME) configuration
certificatesResolvers:
default:
acme:
email: "dev@mydomain.de" # <-- Use your valid email
storage: "/data/acme.json" # <-- Where to store certificate data in the pod
httpChallenge:
entryPoint: "web" # Must be served on port 80
# Ports configuration: set up both HTTP (80) and HTTPS (443)
ports:
web:
address: ":80"
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ":443"
http:
tls:
certResolver: default
# Use a PVC to persist /data
persistence:
enabled: true
name: data
storageClass: "longhorn" # <-- Example RWX storage class
accessMode: ReadWriteMany
size: 1Gi
# Basic logging to see what's happening
logs:
general:
level: INFO
access:
enabled: true
providers:
# Disable the Ingress provider
kubernetesIngress:
enabled: false
# Enable the Gateway API provider
kubernetesGateway:
enabled: true
gateway:
enabled: true
namespacePolicy: All
entryPoints:
- web
- websecure
Gateway Description (kubectl describe gateway -n traefik traefik-gateway
):
Name: traefik-gateway
Namespace: traefik
...
Spec:
Gateway Class Name: traefik
Listeners:
Name: web
Port: 8000
Protocol: HTTP
AllowedRoutes:
Namespaces:
From: Same
...
HTTPRoute:
Name: gitea
Namespace: web-applications
...
Spec:
Hostnames:
git.mydomain.de
ParentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: traefik-gateway
namespace: traefik
sectionName: websecure
Rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- kind: Service
name: gitea
port: 3000
weight: 1
...
When I visit git.mydomain.de
, I see an “unsafe certificate” warning, and the logs show:
<DATE/TIME> DBG ... > Serving default certificate for request: "git.mydomain.de"
<DATE/TIME> DBG ... > http: TLS handshake error from <IP>: remote error: tls: unknown certificate
Has anyone run into a similar issue or have any ideas on what might be missing in my configuration? I suspect there’s a mismatch between the sectionName: websecure
in the HTTPRoute
and the actual listener in the Gateway, but I’m not entirely sure. Any pointers would be greatly appreciated!
T