GitHunt
ZK

zkarahacane/k8s-exams

Self-hosted Kubernetes practice labs for CKA, CKAD, and CKS exam prep. Generated and tested with Claude Code agents.

K8s Certification Practice Labs

Self-hosted Kubernetes practice labs for CKA, CKAD, and CKS exam prep. Generated and tested with Claude Code agents. Runs on a 3-node cluster using minikube or kind (Kubernetes v1.34).

Prerequisites

Tool Version Notes
kubectl 1.34+
Docker 24+
minikube 1.32+ or kind
kind 0.20+ or minikube

Hardware: ~8 GB RAM, 6 CPU cores.

Quick Start

make minikube          # or: make kind
make setup             # deploy exercises (picks lab interactively)
make lab               # interactive runner — pick a lab, navigate, validate

Available Labs

make labs              # list all labs with progress
Lab Exercises Description
cka/lab1 25 CKA Practice Lab
ckad/lab1 20 CKAD Practice Lab
cks/lab1 20 CKS Practice Lab

See CONTRIBUTING.md to create your own labs.

Usage

# All commands show a lab picker if L= is not specified

# Interactive runner (recommended)
make lab                       # lab picker with progress
make lab L=cka/lab1            # resume specific lab
make lab L=cka/lab1 Q=5        # jump to exercise 5

# Batch operations
make setup                     # deploy all exercises
make score                     # validate & score
make solve-all L=cka/lab1      # run all solutions (dev only)

# Per-exercise
make task Q=5                  # show task
make solution Q=5              # show solution
make validate Q=5              # validate one exercise

Architecture

Both runtimes produce an identical 3-node cluster with context cka-lab:

cka-lab
├── control-plane    2 CPU / 2.5 GB
├── worker-1         2 CPU / 2.5 GB
└── worker-2         2 CPU / 2.5 GB

CNI: Calico    Runtime: containerd    K8s: v1.34.0

Runtime differences (node names, etcd paths, StorageClass) are abstracted via cluster.env.

Tested On

  • macOS (Apple Silicon & Intel) — fully tested
  • Linux — should work out of the box, feedback welcome

Project Structure

.
├── Makefile
├── labs/
│   ├── cka/lab1/              # 25 exercises
│   ├── ckad/lab1/             # 20 exercises
│   └── cks/lab1/              # 20 exercises
│       ├── config.sh          #   Metadata, exercise list, setup order
│       └── q01..qNN/          #   task.txt, setup.sh, solution.sh, validate.sh
├── scripts/
│   ├── runner.sh              # Interactive TUI runner
│   ├── list-labs.sh           # Lab discovery + progress
│   ├── score.sh               # Scoring with domain breakdown
│   ├── setup-all.sh           # Deploy exercises
│   ├── solve-all.sh           # Run all solutions
│   ├── bootstrap-{minikube,kind}.sh
│   └── cleanup.sh
├── .state/                    # Progress tracking (gitignored)
└── cluster.env                # Generated runtime config (gitignored)

Scoring

Each lab has a pass threshold of 66%. Exercises are grouped by domain.

make score
  Q01 [ 4 pts] Fix Broken Kubelet on Worker              ✅ PASS
  Q02 [ 5 pts] Fix Broken Deployment (Multi-Issue)        ❌ FAIL
  ...
  TOTAL: 79 / 103  (76%)
  🎉 PASS (>= 66%)

Tips

  • Use the interactive runnermake lab handles task display, validation, and solution viewing in one flow with progress tracking.
  • Simulate exam conditions — time yourself, one terminal per task, use imperative kubectl commands.
  • Allowed resourceskubectl explain, kubectl --help, kubernetes.io/docs.
  • Useful aliases:
    alias k=kubectl
    export do='--dry-run=client -o yaml'
    export now='--force --grace-period=0'
    source <(kubectl completion bash)
    complete -F __start_kubectl k

Cleanup

make clean    # deletes cluster + cluster.env

Languages

Shell99.4%Makefile0.6%

Contributors

MIT License
Created February 23, 2026
Updated March 8, 2026