fix: make default network policy compatible with Cilium dataplane - #216
Draft
mskwierczynski982 wants to merge 2 commits into
Draft
fix: make default network policy compatible with Cilium dataplane#216mskwierczynski982 wants to merge 2 commits into
mskwierczynski982 wants to merge 2 commits into
Conversation
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>
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.
Cilium resolves traffic to security identities and its CIDR selectors only match the
worldidentity. 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:
Checklist
${CHART}/tests/*.py