feat: support externalTrafficPolicy / internalTrafficPolicy on the Service#117
Merged
Merged
Conversation
…rvice Adds optional service.externalTrafficPolicy and service.internalTrafficPolicy values, rendered only when set (mirroring trafficDistribution). externalTrafficPolicy: Local restricts LoadBalancer backends to nodes running pgdog pods, which keeps unrelated node churn (e.g. GKE Autopilot node recycling) off the pooler's data path and preserves client source IPs. Includes a test values file exercising both fields. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DHReZbtuSyGsAh3cskY6Tq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds two optional values to the Service, rendered only when set (same pattern as
trafficDistribution):service.externalTrafficPolicy—ClusterorLocalservice.internalTrafficPolicy—ClusterorLocalAlso adds
test/values-traffic-policy.yaml, which the existingtest/test.shloop picks up; the full suite passes with strict kubeconform validation.Why
When pgdog is exposed through a
LoadBalancerService, the defaultexternalTrafficPolicy: Clustermakes every cluster node an LB backend, with kube-proxy relaying connections that land on pod-less nodes. For a connection pooler holding long-lived Postgres sessions this puts every node in the cluster on the data path: we run pgdog on GKE Autopilot, where routine node recycling was killing established client connections relayed through unrelated dying nodes (ConnectionDoesNotExistErroron long-held sessions,ConnectionRefusedErroragainst booting/draining nodes), while pgdog itself was healthy with clean logs.externalTrafficPolicy: Localrestricts LB backends to the nodes actually running pgdog pods, taking unrelated node churn off the data path (and preserving client source IPs). The chart currently offers no way to set it, so we were patching the Service after everyhelm upgrade.internalTrafficPolicyis included as the natural sibling for in-cluster clients.Both fields default to empty, so existing rendered output is unchanged unless a user opts in.