Question 3
Domain 2: Application Deployment and WorkloadsWhich Kubernetes resource and configuration should be used to run a BusyBox command every minute with the schedule "*/1 * * * *" and print "Hello from the Kubernetes cluster" to standard output?
Correct answer: A
Explanation
A Kubernetes CronJob is the resource designed to run a task on a recurring schedule, and the schedule "*/1 * * * *" means every minute. Using the "busybox" image with a container command like `date; echo Hello from the Kubernetes cluster` makes the pod print the message to standard output each time it runs.
Why each option is right or wrong
A. Create a CronJob using the busybox image with schedule "*/1 * * * *" and a container command that runs `date; echo Hello from the Kubernetes cluster`.
Kubernetes schedules recurring batch work with a CronJob, not a Deployment or Job, and the `schedule` field uses standard cron syntax; `*/1 * * * *` means every minute, i.e., 60-second intervals. Under the CronJob API (`batch/v1`), the pod template can specify the `busybox` image and a container `command` such as `date; echo Hello from the Kubernetes cluster`, which writes the message to stdout each time the scheduled pod starts.
B. Create a Job using the busybox image with `restartPolicy: Always` and a command that runs `date; echo Hello from the Kubernetes cluster`.
C. Create a Deployment using the busybox image with replicas set to 1 and a command that runs `date; echo Hello from the Kubernetes cluster`.
D. Create a Pod using the busybox image and a liveness probe that executes `date; echo Hello from the Kubernetes cluster` every minute.