Kubelings ☸️
Master Kubernetes from scratch through small, interactive, hands-on terminal exercises.
Inspired by the pedagogical brilliance of rustlings, ziglings, and raylings, Kubelings guides engineers through self-paced, iterative exercises. You will fix broken YAML manifests, construct multi-container sidecars, mount storage volumes, write RBAC authorization rules, solve scheduling constraints, build custom Python Kubernetes operators, and troubleshoot production cluster incidents.
Pedagogical Philosophy
Learning Kubernetes from static documentation or raw copy-pasted Helm charts is difficult because feedback is slow and error messages are cryptic. Kubelings solves this through guided, test-driven micro-learning:
- Active Debugging & Iteration: Every exercise starts in a broken or incomplete state containing a
# I AM NOT DONEmarker. You read the problem description, inspect the failure, and edit the code until it passes. - Instant Feedback Loop: An automated watcher observes file modifications in real time, executing in-memory schema validation and spec checks in < 30ms.
- Dual-Mode Learning (Offline & Live Cluster):
- Offline Mode: Zero cluster setup required. Exercises validate Kubernetes object specs, API constraints, and controller behaviors in-memory.
- Live Cluster Mode: Seamlessly connect to
kind,minikube,k3d, or remote clusters. Exercises provision temporary ephemeral namespaces and verify live reconciliations.
- Progressive Hints: When stuck, multi-tiered hints (
kubelings hint) nudge you in the right direction without spoiling the answer.
Architecture
+-----------------------+
| User Terminal |
+-----------+-----------+
|
v
+-----------------------+
| Kubelings CLI (Typer)|
+-----------+-----------+
|
+------------------------+------------------------+
| |
v v
+-----------------------+ +-----------------------+
| File Watcher Engine | | Rich UI & Diagnostics |
| (watchdog) | | (syntax / tables) |
+-----------+-----------+ +-----------------------+
|
v
+-----------------------+
| Curriculum Manifest | (13 Chapters / 62 Exercises)
+-----------+-----------+
|
v
+-----------------------+
| Exercise Runner |
+-----------+-----------+
|
+------------+------------+
| |
v v
+----------------+ +-------------------+
| Offline Schema | | Live Cluster |
| Validator & | OR | Adapter & Ephem. |
| Spec Evaluator | | Namespaces (kind) |
+----------------+ +-------------------+
Quickstart & Installation
Prerequisites
- Python
>= 3.10 uv(recommended) orpip- Optional (for live cluster exercises):
kubectland a local cluster (kind,minikube, ork3d)
Running Instantly (No Clone Needed)
You can run Kubelings anywhere using uvx or pipx:
# Initialize exercises in your current folder
uvx kubelings init
# Start the interactive watch mode
uvx kubelings watch
Or install globally:
pipx install kubelings
kubelings init
kubelings watch
Local Development Installation
Clone the repository and install dependencies in editable mode:
Using uv (Fastest)
git clone https://github.com/dnf0/kubelings.git
cd kubelings
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
Using Standard pip
git clone https://github.com/dnf0/kubelings.git
cd kubelings
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Verify your installation:
kubelings --help
CLI Commands & Usage Guide
1. Watch Mode (Recommended)
Launch the interactive watch loop to monitor your exercise solutions in real time:
kubelings watch
Optionally, resume from a specific exercise:
kubelings watch --start sched01
Workflow:
- Open the indicated file in
exercises/<chapter>/<exercise>.py.- Read the instructions, comments, and task requirements.
- Fix the YAML manifest or Python logic.
- Delete the
# I AM NOT DONEcomment at the top of the file and save.kubelingsvalidates your solution and automatically advances!
2. Run a Single Exercise
Execute and evaluate a single exercise directly:
kubelings run pods01
3. Progressive Hints
Get step-by-step tips for any exercise:
kubelings hint pods01
To display a specific hint tier:
kubelings hint pods01 --hint-num 2
4. List All Chapters & Exercises
Browse the entire curriculum syllabus, descriptions, and exercise paths:
kubelings list
5. Verify Curriculum Progress
Display a rich summary table showing the pass/fail status of all 62 exercises:
kubelings verify
6. Cluster Connectivity Status
Check whether kubelings is running in offline validation mode or connected to a live Kubernetes cluster:
kubelings cluster
7. Initialize Exercises in Any Workspace
If running kubelings via pipx or uvx in a new directory, scaffold the curriculum exercises:
kubelings init
8. Reset an Exercise
Restore any exercise back to its clean starter template:
kubelings reset pods01
9. Version
Display the installed version of Kubelings:
kubelings version
Curriculum & Syllabus
Kubelings covers 13 structured chapters with 62 practical exercises:
| Chapter | Title | Topic Overview | Exercises |
|---|---|---|---|
| 01 | Pods & Core Workloads | Pod specs, multi-container sidecars, init containers, resource requests/limits, Downward API, and Pod Disruption Budgets (PDB). | pods01 – pods06 (6) |
| 02 | Controllers & Replication | ReplicaSets, label selectors, Deployments, rolling updates, rollbacks, StatefulSets, DaemonSets, and Jobs/CronJobs. | ctrl01 – ctrl06 (6) |
| 03 | Configuration & Secrets | ConfigMaps, Secrets, environment variable injection, volume mounts, permission modes, and immutable configs. | config01 – config05 (5) |
| 04 | Storage & Persistent Volumes | Volume types (emptyDir, hostPath), PVs, PVCs, access modes, reclaim policies, StorageClasses, and volume snapshots. |
storage01 – storage05 (5) |
| 05 | Services & Networking | ClusterIP, Headless services, NodePort, LoadBalancer, CoreDNS resolution, ExternalName, and manual Endpoints. | net01 – net05 (5) |
| 06 | Ingress & Gateway API | Ingress path routing, TLS termination, URL rewrite annotations, and modern Gateway API (GatewayClass, HTTPRoute). |
ingress01 – ingress04 (4) |
| 07 | Scheduling & Placement | nodeSelector, node affinity (hard/soft), pod affinity/anti-affinity, taints, tolerations, and topology spread constraints. |
sched01 – sched05 (5) |
| 08 | Security & RBAC | ServiceAccounts, token management, Roles, RoleBindings, ClusterRoles, container securityContext, and Pod Security Standards (PSS). |
rbac01 – rbac05 (5) |
| 09 | Network Policies | Default Deny isolation, Ingress filtering, Egress filtering, CoreDNS egress rules, named ports, and CIDR IPBlock rules. | netpol01 – netpol04 (4) |
| 10 | Lifecycle & Health Probes | Liveness probes, readiness probes, startup probes (exec, httpGet, tcpSocket), and container lifecycle shutdown hooks (preStop). |
health01 – health04 (4) |
| 11 | Workload Autoscaling | Horizontal Pod Autoscaler (HPA v2), custom scale-up/scale-down behaviors, Vertical Pod Autoscaler (VPA), and KEDA event autoscaling. |
autoscale01 – autoscale04 (4) |
| 12 | CRDs & Custom Operators | CustomResourceDefinitions (apiextensions.k8s.io/v1), status subresources, printer columns, Python operator loops, and admission webhooks. |
crd01 – crd04 (4) |
| 13 | Troubleshooting & Incidents | Diagnosing CrashLoopBackOff, OOMKilled, ImagePullBackOff, unschedulable pending pods, ResourceQuotas, and ephemeral debug containers. |
troubleshoot01 – troubleshoot05 (5) |
Contributing
We welcome contributions, new exercises, bug fixes, and documentation improvements! Please check out CONTRIBUTING.md for local development setup, exercise authoring guidelines, and test instructions.
License
Kubelings is distributed under the terms of the Apache-2.0 license.
Metadata
Release files for kubelings 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kubelings-0.1.0.tar.gz | 133.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kubelings-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 251.5 kB
Release files / kubelings-0.1.0.tar.gz
| Download URL | kubelings-0.1.0.tar.gz |
|---|---|
| Size | 133.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cbbb5c5f92567d2d51d7e91dea6992023568199bb85f30bd2c3d8f1c10a8e310
|
|
BLAKE2b-256 checksum How to use checksums |
a61be06e673fb92ddd315a6f5b58410a3cbcb73cc3c771d235a925be81f238af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / kubelings-0.1.0-py3-none-any.whl
| Download URL | kubelings-0.1.0-py3-none-any.whl |
|---|---|
| Size | 118.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
22c1489625683588edff3d2f523f9ae3cd4a74a2609061f8005d846579d64da5
|
|
BLAKE2b-256 checksum How to use checksums |
7f8cffc2deddbd3df948cf88cc802094ece6ed0fecc01d03b6e6b95b87b8090e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|