Pre-Phase-1 platform work, approved and tested earlier but not yet committed: - Terminal banner: "RootNode Academy Lab — node: k8s-lab", upstream KubeKosh attribution left untouched in footer/README/LICENSE. - RootNode curriculum mode: scenarios/rootnode-path.json (Foundation -> Workloads -> Networking -> Configuration -> Troubleshooting -> Real Ops -> Capstone), built from existing scenario content grouped by category, no new scenarios invented. New GET /api/curriculum/path endpoint. - Student roster + per-student progress: instructor-roster, pick-your-name login (no password), students/environments-adjacent progress table migrated to a (student_id, scenario_id) composite key so practice progress and exam sessions are isolated per student instead of one global bucket. New /api/roster, /api/login endpoints. - scenarios/data/*.json: added isolation_type metadata (shared_namespace vs ephemeral_cluster) from an audit of which scenarios execute cluster-scoped or node-level commands. This was Tier-1-isolation groundwork that got superseded same-day by the full-ephemeral-per-student architecture (see docs/LAB_ARCHITECTURE.md) — the field is kept as descriptive metadata only, per the note now in scenarios/SCHEMA.md. Not wasted: it's an accurate audit of which scenarios touch cluster-scoped resources, useful independent of isolation model. - .gitignore added (node_modules/, frontend/dist/, *.db, /data/, .env) — none existed before; without it, npm installs during testing would have landed in a commit. Known limitation still open: no frontend UI for any of this yet (login screen, roster-add form, curriculum view) — API-only. No auth on the roster-add endpoint. Co-Authored-By: Claude Sonnet 5 <[email protected]>
68 lines
2.8 KiB
JSON
68 lines
2.8 KiB
JSON
{
|
|
"id": "pod-disruption-budget-task",
|
|
"title": "Configure a PodDisruptionBudget",
|
|
"category": "Cluster Administration",
|
|
"isolation_type": "shared_namespace",
|
|
"difficulty": "Medium",
|
|
"type": "task",
|
|
"weight": 6,
|
|
"description": "## PodDisruptionBudget\n\nA **PodDisruptionBudget (PDB)** limits the number of pods of a replicated application that are down simultaneously during voluntary disruptions (node drains, cluster upgrades). It is a critical CKA topic.\n\n**Your task:**\n\nA Deployment named `pdb-app` with **3 replicas** is already running. Create a **PodDisruptionBudget** named `web-pdb` in the `default` namespace that:\n- Applies to pods with the label `app=pdb-app`\n- Ensures **at least 2 pods** are always available (`minAvailable: 2`)\n\n```bash\n# Verify:\nkubectl get pdb web-pdb\n```",
|
|
"hints": [
|
|
{
|
|
"title": "PodDisruptionBudget manifest",
|
|
"body": "Use `spec.minAvailable` (integer or percentage) and `spec.selector.matchLabels` to target the right pods.",
|
|
"command": "cat <<EOF | kubectl apply -f -\napiVersion: policy/v1\nkind: PodDisruptionBudget\nmetadata:\n name: web-pdb\nspec:\n minAvailable: 2\n selector:\n matchLabels:\n app: pdb-app\nEOF"
|
|
},
|
|
{
|
|
"title": "Check the PDB status",
|
|
"body": "After creating the PDB, check `kubectl get pdb web-pdb` — the ALLOWED DISRUPTIONS column shows how many pods can be disrupted at once.",
|
|
"command": "kubectl get pdb web-pdb -o wide"
|
|
}
|
|
],
|
|
"setup_commands": [
|
|
{
|
|
"command": "kubectl create deployment pdb-app --image=nginx:alpine --replicas=3 2>/dev/null || true"
|
|
},
|
|
{
|
|
"command": "kubectl rollout status deployment/pdb-app --timeout=90s"
|
|
}
|
|
],
|
|
"validation": {
|
|
"commands": [
|
|
{
|
|
"description": "PDB 'web-pdb' exists",
|
|
"command": "kubectl get pdb web-pdb -o jsonpath='{.metadata.name}'",
|
|
"expected_output": "web-pdb",
|
|
"match": "exact"
|
|
},
|
|
{
|
|
"description": "minAvailable is 2",
|
|
"command": "kubectl get pdb web-pdb -o jsonpath='{.spec.minAvailable}'",
|
|
"expected_output": "2",
|
|
"match": "exact"
|
|
},
|
|
{
|
|
"description": "PDB selector targets app=pdb-app",
|
|
"command": "kubectl get pdb web-pdb -o jsonpath='{.spec.selector.matchLabels.app}'",
|
|
"expected_output": "pdb-app",
|
|
"match": "exact"
|
|
},
|
|
{
|
|
"description": "Deployment 'pdb-app' has 3 replicas",
|
|
"command": "kubectl get deployment pdb-app -o jsonpath='{.spec.replicas}'",
|
|
"expected_output": "3",
|
|
"match": "exact"
|
|
}
|
|
]
|
|
},
|
|
"default_namespace": "default",
|
|
"teardown_commands": [
|
|
{
|
|
"command": "kubectl delete pdb web-pdb --ignore-not-found"
|
|
},
|
|
{
|
|
"command": "kubectl delete deployment pdb-app --ignore-not-found"
|
|
}
|
|
]
|
|
}
|