Skip to content

fix(apisix): render externalTrafficPolicy for ClusterIP with externalIPs - #1020

Open
AGheller wants to merge 1 commit into
apache:masterfrom
AGheller:fix/gateway-externaltrafficpolicy-externalips
Open

AGheller wants to merge 1 commit into
apache:masterfrom
AGheller:fix/gateway-externaltrafficpolicy-externalips

Conversation

@AGheller

@AGheller AGheller commented Oct 13, 2026 •

Copy link
Copy Markdown

Fixes #1019

What

#950 restricted externalTrafficPolicy in the gateway Service to LoadBalancer and NodePort, to fix #755 (the API server rejects the field on a plain ClusterIP Service). Kubernetes also accepts it on a ClusterIP Service with externalIPs, where kube-proxy honors it, and setting it to Local is the way to preserve the client source IP in that setup. Since 2.18.0 the field is silently dropped there and the Service falls back to Cluster.

This PR also renders the field when service.externalIPs is set.

Rendering (helm template --show-only templates/service-gateway.yaml)

Values Before After
type=ClusterIP, externalIPs={1.2.3.4}, externalTrafficPolicy=Local field omitted externalTrafficPolicy: Local
type=ClusterIP, no externalIPs field omitted field omitted (#755 fix kept)
type=NodePort, externalTrafficPolicy=Local Local Local
defaults (type=NodePort) Cluster Cluster

🤖 Generated with Claude Code

Fixes apache#1019

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant