Skip to content

Support Canonical k8s DNS pod labels in network policies#4502

Draft
rene-dekker wants to merge 1 commit intotigera:masterfrom
rene-dekker:ev-6417
Draft

Support Canonical k8s DNS pod labels in network policies#4502
rene-dekker wants to merge 1 commit intotigera:masterfrom
rene-dekker:ev-6417

Conversation

@rene-dekker
Copy link
Member

Summary

  • Canonical Kubernetes labels DNS pods as k8s-app=coredns instead of the standard k8s-app=kube-dns. This causes operator-managed network policies to block DNS traffic on Canonical clusters.
  • Updated all Calico network policy selectors to use an OR expression: k8s-app == 'kube-dns' || k8s-app == 'coredns'
  • Updated the k8s NetworkPolicy DNS rule to use MatchExpressions with In operator for both values
  • Added a second service selector rule for the coredns service name in AppendServiceSelectorDNSEgressRules
  • Updated the tiers cluster DNS policy selector to match both labels

Test plan

  • All pkg/render/... unit test suites pass
  • Verify on a Canonical k8s cluster that DNS egress is allowed
  • Verify on a standard k8s cluster that DNS egress is still allowed

🤖 Generated with Claude Code

Canonical Kubernetes uses the label k8s-app=coredns instead of
k8s-app=kube-dns for DNS pods. Update all network policy selectors
to match either label so policies work on both distributions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rene-dekker rene-dekker requested a review from a team as a code owner March 5, 2026 23:59
@marvin-tigera marvin-tigera added this to the v1.42.0 milestone Mar 5, 2026
@rene-dekker rene-dekker marked this pull request as draft March 6, 2026 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants