Files
rootnode-academy/scenarios/data/env-vars-configmap.json
T
ced4568andClaude Sonnet 5 60fbf0c385 feat(curriculum): add RootNode learning path, student roster, and scenario isolation metadata
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]>
2026-08-18 01:21:16 -05:00

61 lines
2.7 KiB
JSON

{
"id": "env-vars-configmap",
"title": "Environment Variables from ConfigMap",
"category": "Configuration",
"isolation_type": "shared_namespace",
"difficulty": "Easy",
"type": "task",
"weight": 4,
"description": "## Environment Variables from ConfigMap\n\nConfigMaps can inject configuration as environment variables into pods, keeping application images generic and portable.\n\n**Your task:**\n\n1. Create a ConfigMap named `app-env` with two keys:\n - `LOG_LEVEL=debug`\n - `APP_PORT=8080`\n\n2. Create a Pod named `env-pod` using `busybox:1.36` with command `sleep 3600` that loads **all keys** from `app-env` as environment variables using `envFrom`.\n\n**Verify:**\n```bash\nkubectl exec env-pod -- env | grep -E 'LOG_LEVEL|APP_PORT'\n```",
"hints": [
{
"title": "Create the ConfigMap",
"body": "Use `kubectl create configmap` with multiple `--from-literal` flags.",
"command": "kubectl create configmap app-env --from-literal=LOG_LEVEL=debug --from-literal=APP_PORT=8080"
},
{
"title": "Load all ConfigMap keys via envFrom",
"body": "Use `envFrom` with `configMapRef` to load all keys at once — simpler than mapping each key individually.",
"command": "cat <<EOF | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n name: env-pod\nspec:\n containers:\n - name: app\n image: busybox:1.36\n command: [\"sleep\",\"3600\"]\n envFrom:\n - configMapRef:\n name: app-env\nEOF"
}
],
"setup_commands": [],
"validation": {
"commands": [
{
"description": "ConfigMap 'app-env' has LOG_LEVEL=debug",
"command": "kubectl get configmap app-env -o jsonpath='{.data.LOG_LEVEL}'",
"expected_output": "debug",
"match": "exact"
},
{
"description": "ConfigMap 'app-env' has APP_PORT=8080",
"command": "kubectl get configmap app-env -o jsonpath='{.data.APP_PORT}'",
"expected_output": "8080",
"match": "exact"
},
{
"description": "Pod 'env-pod' references app-env via envFrom",
"command": "kubectl get pod env-pod -o jsonpath='{.spec.containers[0].envFrom[0].configMapRef.name}'",
"expected_output": "app-env",
"match": "exact"
},
{
"description": "Pod 'env-pod' is Running",
"command": "kubectl get pod env-pod -o jsonpath='{.status.phase}'",
"expected_output": "Running",
"match": "exact"
}
]
},
"default_namespace": "default",
"teardown_commands": [
{
"command": "kubectl delete configmap app-env --ignore-not-found"
},
{
"command": "kubectl delete pod env-pod --ignore-not-found --grace-period=0 --force"
}
]
}