Challenge
DifficultyEasy
Learner activity No attempts yet
CKA Lab 05: Preferred Node Affinity
Kubernetes foundations with task requirements and automatic verification.
Preferred Node Affinity
Time: About 15 minutes
Use the dev-machine terminal. Each lab starts independently. The lab prepares node-preference-lab; no resources from earlier labs are required.
Choose any Ready, schedulable worker node (not a control-plane node). Keep existing system labels and taints intact. Node names may differ between playgrounds.
- Add label
training.example.com/pool=frontendto at least one Ready, schedulable worker. - Create a standalone Pod named
webinnode-preference-lab. - Configure exactly one
preferredDuringSchedulingIgnoredDuringExecutionnode-affinity preference with weight100. - Its preference must have exactly one
matchExpression: keytraining.example.com/pool, operatorIn, values containing onlyfrontend. Do not usematchFields. - Do not set required node affinity or
nodeSelector. Do not assignspec.nodeNameyourself.
A preference influences scheduling but does not guarantee placement. Verification checks the preference and Pod readiness; it accepts a Pod on another Ready worker.
- Exactly one regular container using image
ghcr.io/iximiuz/labs/nginx:alpine - Pod phase: Running; Ready condition: True
Leave the Pod running and keep your node configuration in place until verification passes.
Choose your own commands or manifests. Checks evaluate the resulting state; command history is not graded.