Where do readiness probes go in a deployment spec?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

Where do readiness probes go in a deployment spec?

Explanation:
Readiness probes are defined for each container inside the pod that a Deployment creates. You specify them in the container's configuration within the pod template, not at the top level of the Deployment or in the status. In practice, you place the readinessProbe under the container in the pod spec of the template, i.e., spec.template.spec.containers[].readinessProbe. This means every container can have its own probe to report when it’s ready to accept traffic. Example snippet: spec: template: spec: containers: - name: app image: myimage readinessProbe: httpGet: path: /health port: 80 initialDelaySeconds: 5 periodSeconds: 10 So the key idea is: readiness probes live inside each container in the pod template, not at the Deployment or status level.

Readiness probes are defined for each container inside the pod that a Deployment creates. You specify them in the container's configuration within the pod template, not at the top level of the Deployment or in the status. In practice, you place the readinessProbe under the container in the pod spec of the template, i.e., spec.template.spec.containers[].readinessProbe. This means every container can have its own probe to report when it’s ready to accept traffic.

Example snippet:

spec:

template:

spec:

containers:

  • name: app

image: myimage

readinessProbe:

httpGet:

path: /health

port: 80

initialDelaySeconds: 5

periodSeconds: 10

So the key idea is: readiness probes live inside each container in the pod template, not at the Deployment or status level.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy