Hedronite · Cert Lesson · Cert-Prep / CNCF · Wed 2026-09-09

CKA Network Policies — least-permissive frontend to backend

Three YAMLs look similar. Only one matches the requirement without extras.

Lesson Class: Cert-Prep (CKA NetworkPolicy)
Bootcamp: Q13 Network Policy · Q8 CNI Network Policy
Read
Labels first.
Reject
Allow-all and extras.
Prove
Exec curl both ways.
Every selector must earn its place.

On the exam, three YAMLs look similar. Only one matches the requirement without extras.

§I — Frame

CKA NetworkPolicy items reward careful reading: namespaces, labels, ports, and which peer selectors appear. Bootcamp Q13 places frontend and backend Deployments in different namespaces and asks you to deploy the least permissive policy that still allows their interaction. Q8 reminds you that the CNI must support NetworkPolicy at all.

§II — Objective map

NeedMechanism
CNI can enforce policyCalico (or VPC CNI policy agent on EKS ops side); not plain Flannel alone
Deny by selectionNetworkPolicy with policyTypes: [Ingress] and empty ingress
Allow specific calleringress.from with namespaceSelector and/or podSelector
Allow CIDRipBlock (wider; reject if requirement is namespace-only)

§III — Q13 drill pattern

  1. Read labels on frontend/backend pods (kubectl get pods -n frontend --show-labels).
  2. Open the candidate policy files.
  3. Reject "allow all ingress."
  4. Reject extras (unexpected IP blocks or namespaces).
  5. Apply the narrow match.
  6. kubectl exec from frontend to backend Service DNS; confirm success.
  7. Optionally exec from a third namespace; confirm failure.

§IV — Exam discriminators

§V — Q8 adjacency

If the cluster has no policy-capable CNI, installing policy YAML will not satisfy a task that requires enforcement. Know which install path you are allowed to use on the exam (manifest versions pinned in the prompt).

§VI — Study drill

Redraw frontend/backend namespaces. Write one policy from memory. Compare to Q13's third candidate. Timebox to 8 minutes.

§VII — Closing

Least permissive means every selector earns its place. Extra CIDRs fail the reading.

Related