From 57d76d013c37d4b3a05cf46e701a67e20ade6448 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Sat, 25 Jul 2026 23:21:11 +0200 Subject: [PATCH] docs: update README to clarify client IP preservation with Traefik and HelmChartConfig --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3b83a31..d22fad0 100644 --- a/README.md +++ b/README.md @@ -128,14 +128,31 @@ curl -si "http:///" By default the app sees a cluster-internal address (for example `10.42.0.1`) instead of the real client IP, because the Traefik Service runs with -`externalTrafficPolicy: Cluster`. To preserve the client IP, apply -[k3s/traefik-config.yaml](k3s/traefik-config.yaml), which sets -`externalTrafficPolicy: Local` on the Traefik Service: +`externalTrafficPolicy: Cluster`. To preserve the client IP, set +`externalTrafficPolicy: Local` on the Traefik Service through a +`HelmChartConfig`, as in [k3s/traefik-config.yaml](k3s/traefik-config.yaml). + +A cluster can hold only one `HelmChartConfig` named `traefik`, so first check +whether one already exists: + +```bash +kubectl get helmchartconfig traefik -n kube-system +``` + +If it does not exist, apply the file as is: ```bash kubectl apply -f k3s/traefik-config.yaml ``` +If it already exists, do not apply the file, as it would replace the existing +Traefik settings. Instead, add `externalTrafficPolicy: Local` under the +`service.spec` section of the existing `valuesContent`: + +```bash +kubectl edit helmchartconfig traefik -n kube-system +``` + #### Option 2: ServiceLB k3s also includes the ServiceLB load balancer. The single `LoadBalancer`