CertLumen

Certified Kubernetes Administrator (CKA) · Section 3 · 20% of the exam

Define and enforce Network Policies

One of the objectives of the Certified Kubernetes Administrator (CKA) exam, in the section “Services and Networking”. Here is what it covers, the points to remember and a question to try.

What it covers

Every Pod gets its own IP and can reach every other Pod without NAT, because a CNI plugin builds the network. NetworkPolicies then restrict that open default: they are additive allow-lists that only work if your CNI enforces them.

Points to remember

  • Every Pod has its own IP and reaches every other Pod without NAT; a CNI plugin implements this
  • No CNI means NotReady nodes and Pending CoreDNS Pods
  • Pod CIDR, Service CIDR and node network must not overlap
  • Pods are non-isolated until a policy selects them for a direction
  • NetworkPolicies are additive allow-lists with no deny rules

Try a question

Policy A selects all Pods in a namespace and denies all ingress. Policy B allows ingress to Pods labelled app=api from Pods labelled app=web on TCP 80. A web Pod connects to an api Pod on TCP 80. What happens?

  1. AThe connection is allowed, because NetworkPolicies are additive
  2. BThe connection is denied, because the deny-all policy was created first
  3. CThe connection is denied, because the more restrictive policy wins
  4. DThe result is undefined unless priorities are set
Show the answer

A. Policies only add permitted connections. A deny-all policy is simply a policy with an empty allow-list for the selected Pods, so a second policy can open specific paths.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Pod Connectivity and Network Policies teaches this objective (about 45 minutes), and 19 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 27 objectives · Next objective →