Kubernetes Scheduling and NetworkPolicy Practice

Free Kubernetes practice for the CKA and KCNA: say where a Pod can be scheduled, which QoS class it gets and what its limits do at run time, or which traffic a NetworkPolicy lets through. Check my answer names the slip, such as adding up limits instead of requests or reading one from entry as two.

Practise

Nodes and Pod

Answer to see the working.

Clusters, names and addresses are made up for practice. Nothing exists beyond what each exhibit shows, and the network plugin enforces NetworkPolicy.

Practise the exams

The CKA curriculum v1.37 lists "Configure Pod admission and scheduling (limits, node affinity, etc.)" and "Define and enforce Network Policies", and the KCNA curriculum lists Scheduling and Networking. The packs below are real exam questions for each exam.

CKA58 real exam questions · US$39
Get the full pack
KCNA333 real exam questions · US$39
Free: 83 questionsGet the full pack

Kubernetes FAQ

How does the scheduler decide if a Pod fits on a node?

It adds up the requests. A Pod's request for CPU or memory is the sum over its containers, and the scheduler only places the Pod where that sum fits in what the node can still give: allocatable minus the requests of the Pods already there. Actual usage does not count. The Kubernetes documentation says the scheduler still refuses a node when the check fails, even if real usage is very low. Limits do not count either.

What if a container sets a limit but no request?

Kubernetes copies the limit and uses it as the request. So a container with only limits still takes up room on the node when the scheduler adds up requests, and it can still count towards the Guaranteed QoS class.

What happens when a container goes over its CPU or memory limit?

CPU and memory behave differently. A CPU limit is enforced by throttling: the container is held to its limit and keeps running, and nothing is terminated for CPU use. A memory limit is enforced with out of memory kills: a container that uses more than its memory limit can be terminated, and it is restarted if it is restartable. Going over a request is allowed as long as the node has the resource available.

How is the QoS class of a Pod worked out?

Guaranteed needs every container to have a CPU limit and a memory limit, each equal to its request. BestEffort means no container has any CPU or memory request or limit. Everything in between is Burstable. The class belongs to the whole Pod, so one container without limits makes the Pod Burstable.

When does a toleration match a taint?

The keys and the effects must be the same, and then either the operator is Exists, or the operator is Equal, which is the default, and the values are equal. Two special cases: an empty key with Exists matches every key, and an empty effect matches every effect. A toleration only lets a Pod onto a tainted node. It does not keep the Pod off other nodes.

What is the difference between NoSchedule, PreferNoSchedule and NoExecute?

NoSchedule keeps new Pods off the node unless they tolerate the taint, and Pods already running stay. PreferNoSchedule is the soft version: the scheduler tries to avoid the node but it is not guaranteed. NoExecute also evicts running Pods that do not tolerate it. A Pod that tolerates it stays, or stays for tolerationSeconds if the toleration sets that.

How do nodeSelector and node affinity combine?

nodeSelector only picks nodes that have every label you list. In node affinity, the entries under nodeSelectorTerms are ORed and the expressions inside one matchExpressions are ANDed. If a Pod has both nodeSelector and node affinity, both must be satisfied. A preferred rule never filters nodes: if no node matches it, the Pod is still scheduled.

When does a NetworkPolicy isolate a Pod?

Only when a policy selects the Pod and lists that direction in policyTypes. Until then all traffic is allowed. If policyTypes is left out, Ingress is always set and Egress is set only when the policy has egress rules. Once a Pod is isolated for a direction, only what the rules of the policies that apply to it allow gets through, and policies add up: they never conflict.

Are namespaceSelector and podSelector ANDed or ORed?

It depends on the dashes. One from entry that holds both selectors picks Pods with that label inside namespaces with that label, so both must match. Two separate entries are alternatives: any Pod in the matching namespaces, or Pods with the label in the policy's own namespace. A podSelector on its own never reaches into other namespaces.

How do ipBlock except and default deny work?

ipBlock allows the cidr range minus every range listed under except. A default deny policy selects all Pods with an empty podSelector and has no rules, so nothing is allowed in that direction until another policy allows it. A deny all egress policy also blocks DNS.

Which exams cover this?

The CKA curriculum v1.37 lists "Configure Pod admission and scheduling (limits, node affinity, etc.)" under Workloads and Scheduling and "Define and enforce Network Policies" under Servicing and Networking. The KCNA curriculum lists Scheduling and Networking among its topics.

Sources
  • Kubernetes documentation, Resource Management for Pods and Containers: requests and limits, CPU throttling and out of memory kills, a limit copied as the request, how Pods with requests are scheduled, allocatable, and the kubectl describe node example (1,800m allocatable minus 680m requested leaves 1.120 CPUs).
  • Kubernetes documentation, Pod Quality of Service Classes and Configure Quality of Service for Pods: the criteria for Guaranteed, Burstable and BestEffort and the four example Pods.
  • Kubernetes documentation, Assign CPU Resources to Containers and Pods and Assign Memory Resources to Containers and Pods: CPU units, a throttled container, an OOMKilled container and a Pod that stays Pending because its request is too big for the nodes.
  • Kubernetes documentation, Taints and Tolerations: when a toleration matches, the three effects, tolerationSeconds and the filter over several taints.
  • Kubernetes documentation, Assigning Pods to Nodes and Kubernetes Scheduler: nodeSelector, required and preferred node affinity, the operators In, NotIn, Exists and DoesNotExist, and filtering before scoring.
  • Kubernetes documentation, Network Policies: the two sorts of isolation, policyTypes defaults, the behaviour of to and from selectors, ipBlock with except, the default policies and the example policy.
  • Exam fit: CNCF CKA Curriculum v1.37 and KCNA Curriculum.
  • Checked 20 November 2026: the drill reproduces the worked examples on these pages, and an independent solver that reads only the exhibit and the question agreed with it on 6,000 generated problems. Left out because the pages give no single answer: a request exactly equal to the room left, NotIn on a node without the label, Pod affinity, the Gt and Lt operators, hostNetwork Pods and traffic from the node itself. This is an independent practice tool, not made or endorsed by the CNCF or The Linux Foundation.

Checked 20 November 2026 against the Kubernetes documentation (v1.37) and the CNCF exam curricula.

More free tools

All free tools