Skip to content

fix: Traefik binds the host's ports, so backends see real client addresses - #728

Closed
lukepolo wants to merge 3 commits into
mainfrom
fix/traefik-host-ports
Closed

lukepolo wants to merge 3 commits into
mainfrom
fix/traefik-host-ports

Conversation

@lukepolo

@lukepolo lukepolo commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Traefik binds the host's ports itself instead of sitting behind k3s ServiceLB, which masquerades every request to its own pod address whenever traffic arrives on an address other than the node's InternalIP (k3s on a VPN or private node IP). Refs #717.

  • Traefik's Service is ClusterIP; install_traefik sets hostPort from HTTP_PORT/HTTPS_PORT, and rollouts replace the pod in place
  • An install still on ingress-nginx keeps Traefik behind ServiceLB for the handover, then move_traefik_to_host_ports moves it onto the ports (update.sh, dev.sh)
  • retire_ingress_nginx only waits for a LoadBalancer address right after a handover
  • Gateway tests reach the node on an address that isn't its InternalIP, and a new job takes a ServiceLB install through the move

…nalIP

kube-proxy answers the node's InternalIP itself, so the tests never went through
ServiceLB, which masquerades every other address. The new servicelb upgrade
test and the unit tests cover Traefik binding the host's ports.
…t's address

k3s ServiceLB masquerades, so behind it every request came from its pod
whenever traffic arrived on an address other than the node's InternalIP.
…es the pod

With host ports the old pod stops before its replacement exists, so a slow or
refused pull would leave nothing serving. Failed kubectl lookups now stop the
install instead of being read as answers.
@lukepolo

lukepolo commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #731, which carries these commits with the k3s Gateway API change so they merge together.

@lukepolo lukepolo closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant