The short version

  • Kubernetes calls a NetworkPolicy desired behavior for selected Pods. Ingress and egress rules are additive, and a Pod-to-Pod connection needs the source egress and destination ingress to agree.
  • The same docs supply the asterisk: a policy without an implementing network controller does nothing; handling is eventual; the API cannot say exactly when it happened; and changes to existing connections are implementation-defined.
  • A defensible claim about one flow needs separate records for the policy revision, selector and endpoint state, network implementation, a time-bounded connection observation, and any identity or application decision.

“Default deny” is one of the most reassuring phrases in Kubernetes. It is also one of the most overworked. A NetworkPolicy is a declarative control surface: selected Pods can be isolated for ingress, egress, or both, while rules describe what remains allowed. That is a governance decision about the intended boundary. It is not evidence that a named connection was denied, that an allowed connection was established, or that a workload was secure. The YAML has the memory of a goldfish and the confidence of a keynote.

Kubernetes draws the first boundary in the resource model. NetworkPolicySpec represents desired behavior. A policy selects Pods, describes Ingress and Egress isolation, and supplies rules. The effects are additive, not ordered overrides. Once a Pod is isolated for a direction, the permitted connections in that direction are the union of what all applicable policies allow. For a connection from one Pod to another, the source egress side and the destination ingress side must both allow it. That is a crucial rule for reading a policy set. It is not a record of the source address, destination address, port, protocol, time, process, packet path, or outcome of a connection.

Selectors are weather, not geology

Selector state is part of the boundary. A podSelector, namespaceSelector, or ipBlock is not a permanent list of concrete endpoints. Labels change. Pods get replaced. Endpoint and Service machinery can reroute the path. The docs warn that ingress and egress mechanisms may rewrite addresses, and where that happens Kubernetes says it is not defined whether rewriting occurs before or after NetworkPolicy processing. Behavior can differ by network plugin, cloud provider, Service implementation, or their combination. A manifest can explain a proposed scope without settling how a particular observed packet was represented at the enforcement point.

The plugin is the missing witness

The implementation layer is separate again. Kubernetes says NetworkPolicy is implemented by the network plugin. It is explicit that creating the API object without a controller that implements NetworkPolicy has no effect. The API can still be present, looking smug. This is not an accusation against an implementation or an administrator; it is a design fact that shrinks the evidence. A cluster object establishes that an object was accepted by the API server. It does not establish which data-plane component was capable, configured, healthy, or active for that policy.

Timing: “eventually” is not a timestamp

Timing matters even where the implementation is conformant. Kubernetes documents that a newly created NetworkPolicy will eventually be handled, but the API offers no way to identify exactly when. It also describes a window in which distributed handling can leave Pods with slightly inconsistent views while Pods or policies change. The effect of a changed policy on an existing connection is implementation-defined. These are not loopholes. They are reasons to stop asking a configuration snapshot to answer a runtime question it was never designed to preserve.

Layer 4 is not the whole story

Protocol scope sets another limit. NetworkPolicy is defined for layer-4 TCP, UDP, and optionally SCTP connections. Kubernetes says behavior for other protocols may vary across network plugins. A policy that appears to draw a general network boundary must therefore not be reworded as a universal assertion about every packet type, every transport, every host-network path, every service mesh, or every identity check. Encryption, workload identity, authentication, DNS resolution, application authorization, and delivery remain different control surfaces unless separately evidenced.

The five-part flow receipt

A defensible claim needs a five-part flow receipt. First, preserve a policy revision: namespace, policy identifier, generation or immutable capture, selector expression, direction, rules, and observation time. Second, preserve the selector and endpoint state: the relevant Pod and Namespace labels, IP or endpoint mapping, and the exact time those states were read. Third, identify the network implementation and its declared NetworkPolicy capability, version, relevant configuration, and health evidence.

Fourth, record a time-bounded connection observation with its source and destination as observed, protocol, port, direction, result, collector, and known visibility limits. Fifth, retain a separate record for any workload identity, authorization, TLS, DNS, application response, or deployment claim. Sensitive details can remain protected; joining identities is not the same thing as publishing them.

Why the distinction survives contact with an incident review

This method protects ordinary outcomes from false narratives. A carefully written policy can be correct and an unrelated data-plane fault can still prevent a connection. A connection can be permitted by both NetworkPolicy directions and then fail DNS, TLS, authentication, application authorization, or a remote service. A policy change can be accepted by the API before a specific plugin has made it effective. A successful request can occur through a path that a reader has not reconstructed. None of these states proves a defect or an incident. They show why one configuration record should not be forced to carry the history of a network flow.

A policy is a promise. A flow receipt is proof. Confusing the two is how bad post-mortems get promoted to best practices.

Sources

  1. Kubernetes — Network Policies
  2. Kubernetes — Services, Load Balancing, and Networking
  3. Kubernetes API reference — NetworkPolicy v1