- 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]>
46 lines
1.9 KiB
JSON
46 lines
1.9 KiB
JSON
{
|
|
"id": "multi-container-pod-basics",
|
|
"title": "Create a Multi-Container Pod",
|
|
"category": "Core Concepts",
|
|
"difficulty": "Easy",
|
|
"type": "task",
|
|
"weight": 5,
|
|
"description": "## Multi-Container Pods\n\nPods can contain multiple containers that share the same network namespace and storage volumes. This is often used for the 'sidecar' pattern.\n\n**Your task:**\n\nCreate a Pod named `web-sidecar` in the `default` namespace with two containers:\n1. Name: `app`, Image: `nginx:alpine`\n2. Name: `sidecar`, Image: `busybox:1.36`, Command: `sleep 3600`\n\nVerify it is running:\n```bash\nkubectl get pod web-sidecar\n```",
|
|
"hints": [
|
|
{
|
|
"title": "Manifest Structure",
|
|
"body": "Your `spec.containers` array needs two items.",
|
|
"command": "cat <<EOF | kubectl apply -f -\napiVersion: v1\nkind: Pod\nmetadata:\n name: web-sidecar\nspec:\n containers:\n - name: app\n image: nginx:alpine\n - name: sidecar\n image: busybox:1.36\n command: [\"sleep\", \"3600\"]\nEOF"
|
|
}
|
|
],
|
|
"setup_commands": [],
|
|
"validation": {
|
|
"commands": [
|
|
{
|
|
"description": "Pod 'web-sidecar' exists",
|
|
"command": "kubectl get pod web-sidecar -o jsonpath='{.metadata.name}'",
|
|
"expected_output": "web-sidecar",
|
|
"match": "exact"
|
|
},
|
|
{
|
|
"description": "Pod has 2 containers",
|
|
"command": "kubectl get pod web-sidecar -o jsonpath='{.spec.containers[*].name}' | wc -w | tr -d ' '",
|
|
"expected_output": "2",
|
|
"match": "exact"
|
|
},
|
|
{
|
|
"description": "Pod is Running",
|
|
"command": "kubectl get pod web-sidecar -o jsonpath='{.status.phase}'",
|
|
"expected_output": "Running",
|
|
"match": "exact"
|
|
}
|
|
]
|
|
},
|
|
"default_namespace": "default",
|
|
"teardown_commands": [
|
|
{
|
|
"command": "kubectl delete pod web-sidecar --ignore-not-found --grace-period=0 --force"
|
|
}
|
|
]
|
|
}
|