Skip to content

fix: make default network policy compatible with Cilium dataplane - #216

Draft
mskwierczynski982 wants to merge 2 commits into
masterfrom
feat/cilium-readiness
Draft

fix: make default network policy compatible with Cilium dataplane#216
mskwierczynski982 wants to merge 2 commits into
masterfrom
feat/cilium-readiness

Conversation

@mskwierczynski982

Copy link
Copy Markdown
Contributor

Cilium resolves traffic to security identities and its CIDR selectors only match the world identity. Azure NPM matched raw addresses, so rules that work today stop matching once the dataplane changes.

network-policy.yaml - add namespaceSelector/podSelector peers to both ipBlock rules. They sit inside the existing rules so they inherit the port lists and widen nothing. Without them, Traefik loses access to app pods: the policies do not name the traefik namespace and admit it only through ipBlock 0.0.0.0/0 matching Traefik's pod IP.

cilium-network-policy.yaml - new, egress only. Node addresses resolve to the host / remote-node identities, which no ipBlock rule can match, and NPM's implicit pod-to-own-node allow does not carry over. Covers Azure IMDS at 169.254.169.254, which is link-local and resolves to host, so toCIDR would not match it. Rendered under the same switch as the NetworkPolicy.

Also adds port 8443 alongside the long-standing 8433 typo in the external egress rule, and drops the unused redisCidr value. Tests reworked to match rules by content rather than list position, so adding a peer or a port no longer breaks every assertion below it.

Requires the cilium.io/v2 CRD, so this chart version must only be consumed by clusters already running Azure CNI powered by Cilium.

Description

Briefly describe the problem and solution. Please remember to create 1 PR per 1 chart in case of dependency between them, otherwise PR gate will fail.

Chart

Select the chart that you are modifying:

  • core
  • dotnet-core
  • cron-job
  • job
  • app-reverse-proxy
  • pact-broker
  • ado-build-agents
  • ado-agent-cleaner
  • event-worker

Checklist

  • Description provided
  • Linked issue
  • Chart version bumped
  • README.md updated with any new values or changes
  • Updated template tests in ${CHART}/tests/*.py

mskwierczynski982 and others added 2 commits August 13, 2026 14:49
Cilium resolves traffic to security identities and its CIDR selectors only
match the `world` identity. Azure NPM matched raw addresses, so rules that
work today stop matching once the dataplane changes.

network-policy.yaml - add namespaceSelector/podSelector peers to both
ipBlock rules. They sit inside the existing rules so they inherit the port
lists and widen nothing. Without them, Traefik loses access to app pods:
the policies do not name the traefik namespace and admit it only through
ipBlock 0.0.0.0/0 matching Traefik's pod IP.

cilium-network-policy.yaml - new, egress only. Node addresses resolve to
the host / remote-node identities, which no ipBlock rule can match, and
NPM's implicit pod-to-own-node allow does not carry over. Covers Azure IMDS
at 169.254.169.254, which is link-local and resolves to `host`, so toCIDR
would not match it. Rendered under the same switch as the NetworkPolicy.

Also adds port 8443 alongside the long-standing 8433 typo in the external
egress rule, and drops the unused redisCidr value. Tests reworked to match
rules by content rather than list position, so adding a peer or a port no
longer breaks every assertion below it.

Requires the cilium.io/v2 CRD, so this chart version must only be consumed
by clusters already running Azure CNI powered by Cilium.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant