Strip apiserver endpoint env vars on non-cluster-host Typha by default#4846
Merged
caseydavenport merged 2 commits intoMay 21, 2026
Merged
Conversation
The non-cluster-host Typha is pod-networked, so it should use the default in-cluster kubernetes Service that kubelet injects into every pod. Always strip the inherited KUBERNETES_SERVICE_HOST/PORT (which come from the host-network endpoint, e.g. proxy.local on MKE) and only override when a pod-network endpoint is explicitly configured.
This was referenced May 21, 2026
coutinhop
approved these changes
May 21, 2026
caseydavenport
added a commit
that referenced
this pull request
May 22, 2026
#4846) (#4847) * Strip apiserver endpoint env vars on non-cluster-host Typha by default The non-cluster-host Typha is pod-networked, so it should use the default in-cluster kubernetes Service that kubelet injects into every pod. Always strip the inherited KUBERNETES_SERVICE_HOST/PORT (which come from the host-network endpoint, e.g. proxy.local on MKE) and only override when a pod-network endpoint is explicitly configured. * Use slices.DeleteFunc instead of bespoke env-var filter helper
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.
Follow-up to #4840.
The previous fix only overrode
KUBERNETES_SERVICE_HOST/PORTon the non-cluster-host Typha when an explicit pod-network endpoint was configured. If it wasn't, the NCH Typha still inherited the host-network endpoint (e.g.proxy.local:6444on MKE) and crashlooped just like before.Since the NCH Typha runs pod-networked, it should default to the in-cluster
kubernetesService that kubelet injects into every pod. Always strip the inherited env vars intyphaEnvVarsNonClusterHost, and only re-add them ifK8sServiceEpPodNetworkis set explicitly.Related: https://tigera.atlassian.net/browse/CI-1987