CertLumen

Certified Kubernetes Application Developer (CKAD) · Section 5 · 20% of the exam

Demonstrate basic understanding of NetworkPolicies

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

What it covers

By default every Pod can talk to every other Pod. A NetworkPolicy selects Pods and lists the traffic allowed to or from them. This lesson covers isolation, default-deny, selector logic (the AND versus OR trap), ipBlock, ports, egress and DNS, and how to test a policy.

Points to remember

  • Without a policy selecting it, a Pod accepts and sends all traffic.
  • A CNI that supports NetworkPolicy must enforce it; otherwise the object has no effect.
  • A Pod is isolated for a direction once any policy selects it with that policyType.
  • Policies are additive (union). There are no deny rules and no priorities.
  • podSelector: {} selects all Pods in the policy's namespace.

Try a question

A rule in an ingress policy contains ports with TCP 6379 but no from field. Which sources can connect to the selected Pods on TCP 6379?

  1. ANo source, because a rule needs from to allow anything
  2. BAny source: a rule without from matches all peers
  3. COnly Pods in the policy's own namespace
  4. DOnly the kubelet on the node
Show the answer

B. Within a rule, an omitted from/to matches every peer, and an omitted ports matches every port. Combine them deliberately.

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

In the course

The lesson NetworkPolicies teaches this objective (about 40 minutes), and 16 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 24 objectives · Next objective →