Skip to main content

Kubelings ☸️

CI License: Apache-2.0 Python: 3.10+ Code style: ruff Type checker: pyright

Master Kubernetes from scratch through small, interactive, hands-on terminal exercises.

Kubelings Terminal Demo

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:

  1. Active Debugging & Iteration: Every exercise starts in a broken or incomplete state containing a # I AM NOT DONE marker. You read the problem description, inspect the failure, and edit the code until it passes.
  2. Instant Feedback Loop & Interactive Hotkeys: An automated watcher observes file modifications in real time (< 30ms). Press h to reveal progressive hints, r to force a rerun, l to list exercises, or q to quit.
  3. 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.
  4. 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 |
         |      (watchfiles)     |                         |    (syntax / tables)  |
         +-----------+-----------+                         +-----------------------+
                     |
                     v
         +-----------------------+
                      |
                      v
          +-----------------------+
          |  Curriculum Manifest  |  (23 Chapters / 102 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) or pip
  • Optional (for live cluster exercises): kubectl and a local cluster (kind, minikube, or k3d)

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

Interactive Learning Commands

1. Watch Mode (kubelings watch)

Start the interactive development loop. Whenever you save a file in exercises/, Kubelings immediately evaluates your changes.

kubelings watch

Interactive Hotkeys:

  • h : Reveal progressive hint tier
  • r : Force rerun current exercise
  • l : List curriculum exercises
  • q : Exit watcher

2. Interactive Terminal TUI Dashboard (kubelings tui / kubelings dashboard)

Explore the curriculum, browse code, and trigger evaluations inside a split-pane full-screen terminal interface:

kubelings tui
# or
kubelings dashboard

3. Resource Relationship Topology Visualizer (kubelings tree)

Render an architectural relationship topology tree of Kubernetes workloads, services, endpoints, volumes, and network policies:

kubelings tree pods01
# or inspect an external manifest
kubelings tree deployment.yaml

4. Universal Manifest Linter (kubelings lint)

Audit any Kubernetes manifest against security standards, reliability probes, and schema best practices:

kubelings lint exercises/01_pods/pods01.py
# or lint production manifests
kubelings lint manifests/production/

5. Run a Single Exercise

Execute and evaluate a single exercise directly:

kubelings run pods01

6. Progressive Hints

Get step-by-step tips for any exercise:

kubelings hint pods01

7. List All Chapters & Exercises

Browse the entire curriculum syllabus, descriptions, and exercise paths:

kubelings list

8. Verify Curriculum Progress

Display a rich summary table showing the pass/fail status of all 102 exercises:

kubelings verify

9. Test Reference Solutions

Run built-in self-testing across reference solutions:

kubelings test

10. Cluster Connectivity Status

Check whether kubelings is running in offline validation mode or connected to a live Kubernetes cluster:

kubelings cluster

VS Code & Cursor Extension 💻

Kubelings provides an official extension for Visual Studio Code and Cursor that turns your editor into a fully integrated Kubernetes learning IDE.

✨ Extension Features

  • 📚 Activity Bar Curriculum Tree View: Browse all 23 chapters and 102 exercises directly from the sidebar with real-time pass/fail status and chapter completion counters.
  • 📊 Status Bar Progress Indicator: Persistent status bar item showing your total completion percentage, current progress, and next active exercise. Click to jump straight to the exercise.
  • ⚡ On-Save Diagnostics: Automatic in-editor validation whenever you save an exercise manifest (exercises/**/*.py), surfacing schema errors, missing attributes, or remaining # I AM NOT DONE markers.
  • 💡 Code Actions & Quick Fixes: Lightbulb quick fixes directly on errors to:
    • Reveal Hint: Display progressive hints in the editor without spoiling the answer.
    • Compare with Reference Solution: Instantly open a side-by-side diff comparing your exercise code against the official reference solution.
  • 🔍 Solution Diffing: Interactive diff viewer (kubelings.showSolutionDiff) for visual code comparison.
  • 💻 Integrated Terminal Watch Mode: Launch kubelings watch into a dedicated integrated terminal with a single click.

📦 Extension Installation

Via Command Line (VSIX)

# For VS Code
code --install-extension dist/kubelings-vscode.vsix

# For Cursor
cursor --install-extension dist/kubelings-vscode.vsix

Via Editor UI (VSIX)

  1. Open the Extensions view (Ctrl+Shift+X / Cmd+Shift+X).
  2. Click the ... (Views and More Actions) menu in the top-right corner of the Extensions pane.
  3. Select Install from VSIX... and choose dist/kubelings-vscode.vsix (available from the repository root after make vscode-package or downloaded from GitHub Releases).

Curriculum & Syllabus

Kubelings covers 23 structured chapters with 102 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 & Traffic Management Ingress path routing, TLS termination, URL rewrite annotations, and ingress class controllers. 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)
14 GitOps & ArgoCD ArgoCD Application CRDs, automated sync policies, self-heal drift correction, ApplicationSets, and progressive delivery with Argo Rollouts. gitops01 – gitops04 (4)
15 Service Mesh & Cilium eBPF Layer 7 HTTP NetworkPolicies, strict mutual TLS (mTLS), clusterwide egress FQDN rules, and Hubble/OpenTelemetry mesh observability. mesh01 – mesh04 (4)
16 Policy as Code (Kyverno & Gatekeeper) Kyverno ClusterPolicies, mutate & generate rules, OPA Gatekeeper ConstraintTemplates and Rego admission policies. policy01 – policy04 (4)
17 Multi-Tenancy & Virtual Clusters Hierarchical Namespace Controller (HNC) subnamespaces, ResourceQuota limits, vcluster control planes, and isolation. tenant01 – tenant04 (4)
18 Advanced Admission Webhooks Dynamic MutatingWebhookConfigurations, ValidatingWebhookConfigurations, sidecar injection, and CRD conversion webhooks. webhook01 – webhook04 (4)
19 Package Management with Helm Helm Chart.yaml v3 metadata, Go templating, _helpers.tpl, values.schema.json validation, and subchart overrides. helm01 – helm04 (4)
20 Declarative Customization with Kustomize kustomization.yaml bases, configMapGenerator, secretGenerator, strategic merge patches, and multi-environment overlays. kustomize01 – kustomize04 (4)
21 Gateway API & Traffic Routing Next-gen Gateway API standard (GatewayClass, Gateway, HTTPRoute), canary traffic splitting, URL rewrite filters, and ReferenceGrant. gateway01 – gateway04 (4)
22 Infrastructure as Data (Crossplane) CompositeResourceDefinitions (XRD), Compositions, Managed Resources, and application-level self-service Claims. crossplane01 – crossplane04 (4)
23 eBPF Security & Observability (Tetragon) Real-time kernel sys_execve process tracing, sensitive file access auditing, synchronous Sigkill enforcement, and socket connect tracing. tetragon01 – tetragon04 (4)

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.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kubelings 0.6.2
File Size Uploaded
kubelings-0.6.2.tar.gz 462.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kubelings 0.6.2
File Interpreter ABI Platform
kubelings-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 635.6 kB

Release files / kubelings-0.6.2.tar.gz

Download URL kubelings-0.6.2.tar.gz
Size 462.0 kB
Tags Source
SHA-256 checksum
How to use checksums
891e17e6d606a58cbf33cba691f67ed9e386a7573d3e71c4bf9d9f76cbcf7e7a
BLAKE2b-256 checksum
How to use checksums
7e2b9a6f3e64bb165b1de94670b87aa0fadb79904f715a009ca1e304fe760189
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kubelings-0.6.2-py3-none-any.whl

Download URL kubelings-0.6.2-py3-none-any.whl
Size 173.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fec337d5e7760b73e376293538a3d4e11820230b1d75d155451e99235bbdaf8
BLAKE2b-256 checksum
How to use checksums
720637a81fcfccc1a2cee2cfecee4c295d3aa62a18709b1018a2a2d28817d76e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.10.1

2 release files

0.10.0

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

This release

0.6.2 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page