CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Administrator

NetworkPolicy Default Deny

Prove that an empty cluster lets everything talk to everything, close it with a four-line policy, then open exactly one path. The failure mode is a timeout rather than a refusal, and knowing that difference is most of the diagnosis.

Services and Networking Guide 61 of 103 Intermediate

NetworkPolicy is an API with no built-in implementation. Without a CNI that enforces it, every policy here is silently ignored.

Three Pods in one namespace and one in another, so both podSelector and namespaceSelector can be tested.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

This guide includes

Use this when a namespace that is currently wide open has to be closed. This matters because an empty cluster lets everything reach everything, and the four-line policy that changes that is the one worth knowing by heart.

Before you start

  1. The default is that everything can reach everything

  2. Default deny, in four lines

  3. Allow exactly one path

Official sources