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]>
52 lines
2.7 KiB
JSON
52 lines
2.7 KiB
JSON
{
|
|
"id": "pod-env-vars-inline",
|
|
"title": "Pod with Inline Environment Variables",
|
|
"category": "Configuration",
|
|
"isolation_type": "shared_namespace",
|
|
"difficulty": "Easy",
|
|
"type": "task",
|
|
"weight": 4,
|
|
"description": "## Pod with Inline Environment Variables\n\nContainers can receive configuration through environment variables from three sources:\n1. **Inline literals** — hardcoded directly in the pod spec (`env[].value`)\n2. **ConfigMap** — loaded from a ConfigMap key\n3. **Secret** — loaded from a Secret key\n\nThis scenario focuses on source **#1**: setting environment variables directly in the pod spec.\n\n**Your task:**\n\nCreate a Pod named `env-demo` using image `busybox:1.36` with command `sleep 3600` and the following environment variables set **inline** (not from a ConfigMap or Secret):\n\n| Name | Value |\n|---|---|\n| `APP_COLOR` | `blue` |\n| `APP_MODE` | `production` |\n\n```bash\n# Verify the env vars are set inside the container:\nkubectl exec env-demo -- env | grep APP_\n```",
|
|
"hints": [
|
|
{
|
|
"title": "Setting env vars with kubectl run",
|
|
"body": "The quickest way: use `kubectl run` with one `--env` flag per variable.",
|
|
"command": "kubectl run env-demo --image=busybox:1.36 --command --env=APP_COLOR=blue --env=APP_MODE=production -- sleep 3600"
|
|
},
|
|
{
|
|
"title": "Setting env vars in a manifest",
|
|
"body": "In a YAML manifest, use the `env` array under the container spec. Each entry has a `name` and `value` field.",
|
|
"command": "cat <<EOF | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n name: env-demo\nspec:\n containers:\n - name: app\n image: busybox:1.36\n command: [\"sleep\", \"3600\"]\n env:\n - name: APP_COLOR\n value: \"blue\"\n - name: APP_MODE\n value: \"production\"\nEOF"
|
|
}
|
|
],
|
|
"setup_commands": [],
|
|
"validation": {
|
|
"commands": [
|
|
{
|
|
"description": "Pod 'env-demo' is Running",
|
|
"command": "kubectl get pod env-demo -o jsonpath='{.status.phase}'",
|
|
"expected_output": "Running",
|
|
"match": "exact"
|
|
},
|
|
{
|
|
"description": "APP_COLOR is set to 'blue'",
|
|
"command": "kubectl get pod env-demo -o jsonpath='{.spec.containers[0].env[?(@.name==\"APP_COLOR\")].value}'",
|
|
"expected_output": "blue",
|
|
"match": "exact"
|
|
},
|
|
{
|
|
"description": "APP_MODE is set to 'production'",
|
|
"command": "kubectl get pod env-demo -o jsonpath='{.spec.containers[0].env[?(@.name==\"APP_MODE\")].value}'",
|
|
"expected_output": "production",
|
|
"match": "exact"
|
|
}
|
|
]
|
|
},
|
|
"default_namespace": "default",
|
|
"teardown_commands": [
|
|
{
|
|
"command": "kubectl delete pod env-demo --ignore-not-found --grace-period=0 --force"
|
|
}
|
|
]
|
|
}
|