How I Fixed Argo CD Behind K3s Traefik (No More Redirect Loops!) π€β‘οΈπ
Setting up Argo CD behind Traefik in my K3s homelab turned into a rabbit hole of redirect loops, 404s, and Traefik annotations gone rogue.
After hours of poking around, hereβs exactly what caused the problem β and how I fixed it. π§
π₯ The Problem
Argo CD was deployed, Traefik (from K3s) was routing traffic, but visiting:
https://argo.elladali.com/
resulted in:
β ERR_TOO_MANY_REDIRECTS
And sometimes:
β 404 Not Found
Even though the Ingress was configured correctly.
π© The Culprits: Evil Annotations
I had these annotations on my Ingress:
traefik.ingress.kubernetes.io/forwardedHeaders: "true"
traefik.ingress.kubernetes.io/ssl-redirect: "true"
traefik.ingress.kubernetes.io/protocol: "https"
π These caused redirect loops and 404s. Once I commented them out, everything started working.
β The Fix
Hereβs what I changed:
Ingress (π« no middleware, no CRDs!)
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-server-ingress
namespace: argocd
annotations:
kubernetes.io/ingress.class: traefik
# π§Ό Removed the problematic headers
spec:
rules:
- host: argo.elladali.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: argocd-server
port:
number: 80
ConfigMap
Make sure your argocd-cmd-params-cm
ConfigMap looks like this:
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cmd-params-cm
namespace: argocd
data:
server.insecure: "true" # allows plain HTTP internally
server.rootpath: "/" # important for base routing
server.basehref: "/" # same here
server.enable.proxy: "true" # tells Argo CD to trust proxy headers
Then restart the Argo CD server:
kubectl -n argocd rollout restart deployment argocd-server
π Result
Now I can access Argo CD through my Cloudflare tunnel + Traefik in K3s, no TLS in-cluster, no Middleware, and no CRDs.
Clean, simple, and works.
If youβre getting stuck behind Traefik in a K3s setup, try this minimalist approach before pulling in heavy Helm charts or debugging Traefikβs internals.
Happy hacking! π¨βπ»π°οΈ