Files
rootnode-academy/scenarios/data/exec-command-basics.json
T
Abhinav Sinha 124e5276d4 refactor(scenarios): split monolithic configuration into individual files
- Split `scenarios/scenarios.json` into individual JSON files under `scenarios/data/` named `<scenario-id>.json`
- Split `scenarios/bundles.json` into individual JSON files under `scenarios/bundles/` named `<bundle-id>.json`
- Updated `backend/server.js` to dynamically load scenario and bundle files from their respective directories
- Updated documentation in `scenarios/SCHEMA.md` and `README.md` to reflect the new repository layout and contributor workflow

Signed-off-by: Abhinav Sinha <[email protected]>
2026-06-15 07:52:47 +05:30

41 lines
1.4 KiB
JSON

{
"id": "exec-command-basics",
"title": "Execute Commands in Pods",
"category": "Troubleshooting",
"difficulty": "Easy",
"type": "task",
"weight": 3,
"description": "## Execute Commands in Pods\n\nSometimes you need to run arbitrary commands inside a running container to debug or change state.\n\n**Your task:**\n\nA pod named `worker-pod` is running. Use `kubectl exec` to create an empty file at `/tmp/ready` inside the container.\n\n```bash\n# Verify the file was created:\nkubectl exec worker-pod -- ls /tmp/ready\n```",
"hints": [
{
"title": "Use kubectl exec",
"body": "You can pass commands to the container by adding `--` after the pod name.",
"command": "kubectl exec worker-pod -- touch /tmp/ready"
}
],
"setup_commands": [
{
"command": "kubectl run worker-pod --image=busybox:1.36 --command -- sleep 3600"
},
{
"command": "kubectl wait --for=condition=Ready pod/worker-pod --timeout=30s"
}
],
"validation": {
"commands": [
{
"description": "File /tmp/ready exists inside worker-pod",
"command": "kubectl exec worker-pod -- ls /tmp/ready 2>/dev/null",
"expected_output": "/tmp/ready",
"match": "contains"
}
]
},
"default_namespace": "default",
"teardown_commands": [
{
"command": "kubectl delete pod worker-pod --ignore-not-found --grace-period=0 --force"
}
]
}