fix: replace projectcalico.org/name with kubernetes.io/metadata.name in NetworkPolicies - #5151
Open
sivasubramanian95 wants to merge 1 commit into
Conversation
…in NetworkPolicies Replace all uses of the projectcalico.org/name label with the built-in kubernetes.io/metadata.name label in operator-managed NetworkPolicy namespace selectors (both Calico v3 and Kubernetes NetworkPolicies). On platforms where the Calico namespace controller is not enabled (e.g., EKS with AmazonVPC CNI), the projectcalico.org/name label is never applied to namespaces, causing NetworkPolicy rules that reference it to never match. This breaks DNS resolution for operator components like Whisker and Goldmane. The kubernetes.io/metadata.name label is automatically applied by Kubernetes to all namespaces since v1.21 and requires no controller. Fixes tigera#4624
Member
|
Thansk for the PR! Before merging, you will need to sign the CLA to make the bot happy. |
Author
|
Just signed the CLA. thanks |
Author
|
Thanks for the review, @caseydavenport ! - looks like the GitHub Actions checks are stuck in action_required and need a maintainer to approve the workflow run. Could you kick that off when you get a chance? |
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.
Type: Bug fix / enhancement
Why: On platforms where the Calico namespace controller is not enabled (e.g., EKS with AmazonVPC CNI, where ENABLED_CONTROLLERS=node,loadbalancer), the projectcalico.org/name label is never applied to
namespaces. Operator-managed NetworkPolicies reference this label in namespace selectors, so their rules never match — breaking DNS resolution for components like Whisker and Goldmane.
Fix: Replace all uses of projectcalico.org/name with kubernetes.io/metadata.name in namespace selectors (both Calico v3 and Kubernetes NetworkPolicies). This label is automatically applied by
Kubernetes to all namespaces since v1.21 and requires no controller.
Components affected:
Testing:
Issue: #4624 (#4624)
Fixes #4624
Release Note
Operator-managed NetworkPolicies now use the kubernetes.io/metadata.name label for namespace selectors instead of projectcalico.org/name. This fixes DNS resolution failures on platforms where the
Calico namespace controller is not enabled (e.g., EKS with AmazonVPC CNI).
For PR author