Skip to content

Adding service.externalTrafficPolicy to the Helm chart - #15

Merged
Phil Gran (philgran) merged 3 commits into
mainfrom
phil/add-external-traffic-policy
Jul 17, 2026
Merged

Adding service.externalTrafficPolicy to the Helm chart#15
Phil Gran (philgran) merged 3 commits into
mainfrom
phil/add-external-traffic-policy

Conversation

@philgran

Copy link
Copy Markdown
Contributor

Changes

  • values.yaml — new service.externalTrafficPolicy value (default ""), with comments explaining when to use it and its trade-off.
  • templates/service.yaml — renders externalTrafficPolicy in the Service spec, but only when the value is set and service.type is NodePort or LoadBalancer (the Kubernetes API rejects the field on ClusterIP services).
  • README.md — documented the new parameter in the configuration table.
  • Chart.yaml — bumped chart version 0.7.0 → 0.8.0.

Behavior before

The Service never set externalTrafficPolicy, so Kubernetes applied its default of Cluster. With an external passthrough load balancer (e.g. GKE Dataplane v2), traffic landing on a node without a firewall pod is SNATed when forwarded to another node, so the firewall sees a link-local address (e.g. 169.254.4.6) instead of the real client IP. The only workaround was patching the Service out-of-band, which the next helm upgrade would revert.

Behavior after

Unset (default), rendering is unchanged and existing deployments are unaffected. Setting service.externalTrafficPolicy: Local with a LoadBalancer or NodePort Service makes the load balancer route only to nodes running a firewall pod, eliminating the SNAT hop and preserving client source IPs. If set while service.type is ClusterIP, the field is silently omitted rather than producing an invalid manifest.

Verified with helm lint and helm template across default, LoadBalancer, NodePort, and ClusterIP configurations.

@philgran
Phil Gran (philgran) force-pushed the phil/add-external-traffic-policy branch from d202945 to c5ac772 Compare July 16, 2026 18:35
@philgran
Phil Gran (philgran) merged commit 0fd600e into main Jul 17, 2026
5 checks passed
@philgran
Phil Gran (philgran) deleted the phil/add-external-traffic-policy branch July 17, 2026 14:25
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.

2 participants