Study guide

4.1 Scheduling, Resource Management & Node Selection

Kubernetes and Cloud Native Associate KCNA

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Introduction & Exam Overview

1.1 About the KCNA Exam & Certification Path 1.2 How to Use This Study Guide

2 Chapter 2: Kubernetes Fundamentals - Cluster Architecture & the API

2.1 Kubernetes Architecture & Control Plane Components 2.2 Worker Node Architecture & Node Components 2.3 Kubernetes API, Declarative Management & kubectl 2.4 Kubernetes Releases, API Versioning & Deprecation Policy

3 Chapter 3: Kubernetes Fundamentals - Workloads & Configuration

3.1 Core Workload Objects (Pods, Deployments & ReplicaSets) 3.2 Advanced Controllers (StatefulSets, DaemonSets, Jobs & CronJobs) 3.3 Namespaces, Labels, Selectors & Annotations 3.4 ConfigMaps, Secrets & Application Configuration 3.5 Pod & Container Lifecycle, Restart Policies & Graceful Termination

4 Chapter 4: Kubernetes Fundamentals - Scheduling & Autoscaling

4.1 Scheduling, Resource Management & Node Selection 4.2 Advanced Scheduling: Affinity, Topology Spread, Priority & Disruption Budgets 4.3 Autoscaling Workloads & Clusters (HPA, VPA, Cluster Autoscaler, KEDA)

5 Chapter 5: Kubernetes Fundamentals - Cluster Administration & Extensibility

5.1 Kubernetes Distributions, Installation Tools & Managed Services 5.2 Cluster Administration: Node Maintenance, Upgrades & etcd Backup 5.3 Extending Kubernetes: CRDs, Operators & the Controller Pattern

6 Chapter 6: Kubernetes Fundamentals - Containerization

6.1 Container Fundamentals, Runtimes & Registries 6.2 Container Image Anatomy: Layers, Tags, Digests & Pull Policy

7 Chapter 7: Container Orchestration - Networking & Service Discovery

7.1 Kubernetes Networking, Services & Ingress 7.2 Cluster DNS & Service Discovery with CoreDNS 7.3 NetworkPolicies, Zero-Trust Segmentation & the Gateway API

8 Chapter 8: Container Orchestration - Storage

8.1 Storage Concepts (PVs, PVCs, StorageClasses & CSI) 8.2 Volume Types, Snapshots & Stateful Storage Operations

9 Chapter 9: Container Orchestration - Security

9.1 Kubernetes Security & Access Control (RBAC & ServiceAccounts) 9.2 The 4C's of Cloud Native Security & Supply-Chain Trust 9.3 Service Mesh, mTLS & Zero-Trust Service Identity

10 Chapter 10: Container Orchestration - Troubleshooting

10.1 Container Troubleshooting & Health Probes 10.2 Cluster & Node-Level Troubleshooting

11 Chapter 11: Cloud Native Application Delivery

11.1 Cloud Native CI/CD Pipelines & Build Tooling 11.2 GitOps & Package Management (Helm, Kustomize, Argo CD & Flux) 11.3 Deployment Strategies & Release Management 11.4 Progressive Delivery Automation: Argo Rollouts, Flagger & Feature Flags 11.5 Application Debugging & Developer Workflows in Kubernetes 11.6 Platform Engineering & Developer Self-Service

12 Chapter 12: Cloud Native Architecture - Observability & Principles

12.1 Cloud Native Observability (Logging, Metrics & Tracing) 12.2 Cloud Native Principles & Architecture Patterns 12.3 Serverless, FaaS & Event-Driven Architecture

13 Chapter 13: Cloud Native Architecture - CNCF Ecosystem & Community

13.1 The CNCF Landscape, Governance & Project Lifecycle 13.2 Cloud Native Community, Collaboration & Contribution

4.1 Scheduling, Resource Management & Node Selection

Key Takeaways Explain This Topic AI

Resource requests define the minimum CPU and memory guaranteed for a container and dictate kube-scheduler pod placement decisions, whereas limits set the hard upper bound of resource consumption.

Memory limit violations trigger operating system kernel Out-Of-Memory termination (OOMKilled state with exit code 137), whereas CPU limit violations cause CPU throttling without terminating the container.

Kubernetes assigns Quality of Service (QoS) classes—Guaranteed, Burstable, and BestEffort—which determine Pod eviction precedence under node memory pressure.

Node affinity rules enable expressive pod scheduling using requiredDuringSchedulingIgnoredDuringExecution (hard rule) and preferredDuringSchedulingIgnoredDuringExecution (soft rule with weights).

Taints applied to nodes repel Pods, while matching Tolerations defined in Pod specs allow Pods to be scheduled on tainted nodes using effects like NoSchedule, PreferNoSchedule, and NoExecute.

Last updated: August 2026

4.1 Scheduling, Resource Management & Node Selection

When a Pod is submitted to the Kubernetes API server, the control plane must decide which worker node has sufficient capacity and matching constraints to run that workload. This placement decision is made by the kube-scheduler . Understanding compute resource specifications, Quality of Service ( QoS ) classes, and node selection mechanics ( nodeSelector , Node Affinity , Taints & Tolerations ) is essential for managing cluster efficiency.

1. Resource Requests vs. Limits

Containers specify their compute resource needs using two attributes inside the container spec: requests and limits .

CPU & Memory Requests

Requests represent the minimum guaranteed resources required by a container.

The kube-scheduler uses the sum of resource requests on a node to evaluate node capacity during scheduling. A node is eligible to run a Pod only if its allocatable capacity exceeds the Pod's total resource requests.

CPU Units : Expressed in millicores ( m ) or fractional cores ( 500m = 0.5 CPU core; 1000m = 1 full vCPU/core).

Memory Units : Expressed in binary bytes using mebibytes ( Mi ) or gibibytes ( Gi ) (e.g., 256Mi , 2Gi ).

CPU & Memory Limits

Limits specify the maximum hard ceiling of resources a container is permitted to consume.

CPU Limit Behavior : Enforced via Linux cgroup Completely Fair Scheduler (CFS) quota. If a container exceeds its CPU limit, the OS throttles the container's CPU usage, causing performance slowdowns without terminating the process.

Memory Limit Behavior : Enforced via Linux cgroups. If a container exceeds its memory limit, the operating system kernel immediately invokes the Out-Of-Memory (OOM) killer, terminating the container process. The Pod enters an OOMKilled state with exit code 137 and is restarted by the Kubelet. resources:

requests:

  • cpu: "250m"
  • memory: "256Mi"

limits:

  • cpu: "500m"
  • memory: "512Mi"
  • 2. Quality of Service (QoS) Classes

When worker nodes experience memory exhaustion, Kubernetes must evict Pods to protect host stability. Kubernetes automatically classifies Pods into three Quality of Service (QoS) classes based on their resource requests and limits configuration:

1. Guaranteed

Criteria : Every container in the Pod must have both CPU and memory requests and limits explicitly specified, and the request value must equal the limit value for every resource.

Eviction Priority : Lowest eviction priority. Guaranteed Pods are only evicted if node memory pressure is extreme and no lower-tier Pods remain.

2. Burstable

Criteria : The Pod does not meet Guaranteed criteria, but at least one container in the Pod has a CPU or memory request specified.

Eviction Priority : Intermediate eviction priority. Burstable Pods can consume extra unallocated node resources up to their limit, but will be evicted before Guaranteed Pods if node memory runs low.

3. BestEffort

Criteria : No containers in the Pod have any CPU or memory requests or limits defined.

Eviction Priority : Highest eviction priority. BestEffort Pods are the very first candidates selected by the Kubelet for termination when a node encounters memory pressure.

3. Node Selection Mechanics

By default, kube-scheduler distributes Pods evenly across healthy nodes. However, workloads often require specific hardware characteristics (such as SSD storage, GPU access, or specific availability zones).

nodeSelector

The simplest node selection mechanism is nodeSelector . It is a hard constraint key-value map placed in the Pod spec that matches node labels. spec:

nodeSelector:

  • disktype: ssd
  • topology.kubernetes.io/zone: us-east-1a
  • Node Affinity and Anti-Affinity

Node Affinity extends nodeSelector with a more expressive expression syntax, supporting logical operators ( In , NotIn , Exists , DoesNotExist , Gt , Lt ).

Node affinity supports two rules:

requiredDuringSchedulingIgnoredDuringExecution : Hard rule. The scheduler must find a node matching the affinity rule, or the Pod remains Pending .

preferredDuringSchedulingIgnoredDuringExecution : Soft rule. The scheduler attempts to place the Pod on a matching node, but can fall back to another node if no match is available. Soft rules include a weight (1–100) to prioritize nodes.

Note

Notice the phrase IgnoredDuringExecution : If node labels change after a Pod is already scheduled and running, the Pod will continue running uninterrupted.

4. Taints and Tolerations

While Node Affinity attracts Pods to specific nodes, Taints and Tolerations allow nodes to repel Pods.

Taints are applied to Nodes ( key=value:effect ). A tainted node refuses any Pod that does not possess a matching toleration.

Tolerations are applied to Pods , allowing (but not forcing) those Pods to be scheduled onto nodes with matching taints.

Taint Effects

NoSchedule : The scheduler will not place new Pods onto the node unless the Pod has a matching toleration. Existing running Pods are not affected.

PreferNoSchedule : The scheduler tries to avoid placing non-tolerating Pods on the node, but can place them there if no other node capacity exists.

NoExecute : New Pods without matching tolerations are blocked from scheduling, and existing running Pods on the node lacking the toleration are immediately evicted . # Command to taint a node:

# kubectl taint nodes node1 dedicated=gpu:NoSchedule

  • apiVersion: v1
  • kind: Pod

metadata:

name: gpu-workload

spec:

containers:

  • name: cuda-app
  • image: nvidia/cuda:12.0

tolerations:

  • key: "dedicated"
  • operator: "Equal"
  • value: "gpu"
  • effect: "NoSchedule"

affinity:

nodeAffinity:

requiredDuringSchedulingIgnoredDuringExecution:

nodeSelectorTerms:

- matchExpressions:

  • key: gpu-type
  • operator: In
  • values: ["nvidia-a100"]
  • 5. QoS & Scheduling Feature Summary
  • QoS / Scheduling Concept Rule / Behavior Key Mechanism
  • Guaranteed QoS Requests == Limits for all containers Highest eviction protection
  • Burstable QoS Requests specified < Limits Intermediate eviction priority
  • BestEffort QoS No requests or limits set First evicted under OOM pressure
  • nodeSelector Simple key-value label match Hard placement rule
  • Node Affinity Expressive expressions (In, NotIn) Hard ( required ) vs Soft ( preferred )
  • Taints & Tolerations Node repels non-tolerating Pods NoSchedule , PreferNoSchedule , NoExecute