Skip to content
CKAWorkloads & SchedulingThree nodesMedium

Spread replicas across nodes

Scenario cka-sch-002 · about 8 minutes · 6 points · 8 grader checks

Create a Deployment whose replicas are guaranteed to land on different nodes.

  • scheduling
  • topology-spread
  • pod-anti-affinity
  • deployment

What you will practise

  • Express a hard spreading constraint in a Pod template
  • Choose between podAntiAffinity and topologySpreadConstraints
  • Verify pod placement with kubectl get pods -o wide

Start this lab

With the CLI installed and signed in, this command provisions a three nodes cluster on your Mac, applies the scenario setup and prints the task below.

goldenkube start cka-sch-002

Task

The task text exactly as the CLI shows it. Solve it on the cluster, then run goldenkube submit.

In namespace "apps" (create it if missing), create a Deployment named "spread" using image nginx:1.27 with 2 replicas and the Pod label app=spread. The Pod template must carry a scheduling constraint that guarantees the 2 replicas run on different nodes (spread by kubernetes.io/hostname); landing on different nodes by chance is not sufficient. Both Pods must be Ready.

Requirements and details

Certification
CKA · Certified Kubernetes Administrator
Domain
Workloads & Scheduling
Difficulty
Medium
Cluster topology
Three nodes
Cluster features
None beyond the base cluster
Recommended time
8 minutes
Points
6
Grader checks
8
Kubernetes version
1.37
Minimum CLI version
0.1.0
Scenario version
1
Published

Grading runs locally: 8 state checks read your cluster when you submit; the scenario passes when every check passes. Hints, the reference solution and the check definitions are available only inside the CLI, not on this page.

CKAWorkloads & SchedulingMedium

Taint, toleration and placement

Taint a worker node and run a Pod that tolerates the taint and is placed on that node.

Two nodes · ~7 min · 6 points

  • taint
  • toleration
  • scheduling
  • nodename

goldenkube start cka-sch-001

CKAWorkloads & SchedulingEasy

Rolling update of a Deployment

Update the image of a running Deployment with a rolling update and confirm all pods run the new image.

Single node · ~4 min · 4 points

  • deployment
  • rolling-update
  • rollout
  • workloads

goldenkube start cka-wkl-002

CKAWorkloads & SchedulingMedium

ConfigMap env var and Secret volume

Create a ConfigMap and a Secret and consume them from a Pod as an environment variable and a mounted volume.

Single node · ~8 min · 6 points

  • configmap
  • secret
  • pod
  • env
  • volume
  • workloads

goldenkube start cka-wkl-003

Independent community project, not affiliated with or endorsed by CNCF or The Linux Foundation. Lab results are practice feedback, not an exam score.