Skip to content

Remove egress restriction from generated NetworkPolicy#17

Merged
glours merged 1 commit intodocker:mainfrom
glours:fix/networkpolicy-remove-egress-restriction
Apr 14, 2026
Merged

Remove egress restriction from generated NetworkPolicy#17
glours merged 1 commit intodocker:mainfrom
glours:fix/networkpolicy-remove-egress-restriction

Conversation

@glours
Copy link
Copy Markdown
Contributor

@glours glours commented Apr 14, 2026

The NetworkPolicy template was restricting both ingress and egress to pods within the same Compose network. This incorrectly blocks DNS resolution (CoreDNS) and any outbound traffic to external services, the host, or non-Compose pods (e.g. telepresence traffic-manager).

Docker Compose's network model only restricts which services can reach each other (ingress), not where they can send traffic. Pods on a Compose network can freely reach DNS, the internet, and the host.

This was previously invisible because common CNIs (Docker Desktop's vpnkit, older kindnet) did not enforce NetworkPolicies. kind v1.34.3+ now ships kindnet with kube-network-policies enabled, making the overly restrictive policy actively break DNS and inter-service communication.

The NetworkPolicy template was restricting both ingress and egress to
pods within the same Compose network. This incorrectly blocks DNS
resolution (CoreDNS) and any outbound traffic to external services,
the host, or non-Compose pods (e.g. telepresence traffic-manager).

Docker Compose's network model only restricts which services can
reach each other (ingress), not where they can send traffic. Pods on
a Compose network can freely reach DNS, the internet, and the host.

This was previously invisible because common CNIs (Docker Desktop's
vpnkit, older kindnet) did not enforce NetworkPolicies. kind v1.34.3+
now ships kindnet with kube-network-policies enabled, making the
overly restrictive policy actively break DNS and inter-service
communication.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@glours glours requested a review from ndeloof April 14, 2026 11:51
@glours glours merged commit be0ca45 into docker:main Apr 14, 2026
4 checks passed
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.

2 participants