- 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]>
40 lines
1.6 KiB
JSON
40 lines
1.6 KiB
JSON
{
|
|
"id": "jobs-cronjobs-mcq",
|
|
"title": "Jobs vs CronJobs",
|
|
"category": "Workloads",
|
|
"difficulty": "Easy",
|
|
"type": "mcq",
|
|
"weight": 3,
|
|
"description": "## Jobs vs CronJobs\n\nA data-processing team needs to run a database backup script **every night at midnight**. Which Kubernetes resource should they use, and why?",
|
|
"options": [
|
|
{
|
|
"id": "a",
|
|
"text": "A `Job` — because Jobs run a task until it completes successfully, including on a nightly schedule"
|
|
},
|
|
{
|
|
"id": "b",
|
|
"text": "A `CronJob` — because it creates Jobs on a time-based schedule (cron syntax) and is designed for recurring tasks"
|
|
},
|
|
{
|
|
"id": "c",
|
|
"text": "A `Deployment` with `restartPolicy: OnFailure` — deployments keep tasks running on schedule"
|
|
},
|
|
{
|
|
"id": "d",
|
|
"text": "A `DaemonSet` — because it ensures exactly one backup process per node nightly"
|
|
}
|
|
],
|
|
"correct_option": "b",
|
|
"explanation": "A **CronJob** is the right resource for recurring scheduled tasks. It uses standard cron syntax (e.g. `0 0 * * *` for midnight daily) and creates a new `Job` object at each scheduled time. A plain `Job` runs once to completion — you would need external scheduling to run it nightly. Deployments are for long-running services, and DaemonSets run pods on every node.",
|
|
"hints": [
|
|
{
|
|
"title": "CronJob syntax",
|
|
"body": "CronJobs use standard cron format: `minute hour day-of-month month day-of-week`. For midnight daily: `0 0 * * *`.",
|
|
"command": "kubectl explain cronjob.spec.schedule"
|
|
}
|
|
],
|
|
"setup_commands": [],
|
|
"default_namespace": "default",
|
|
"teardown_commands": []
|
|
}
|