Exam AZ-400 All QuestionsBrowse all questions from this exam
Question 35

HOTSPOT -

You have an Azure Kubernetes Service (AKS) pod.

You need to configure a probe to perform the following actions:

✑ Confirm that the pod is responding to service requests.

✑ Check the status of the pod four times a minute.

✑ Initiate a shutdown if the pod is unresponsive.

How should you complete the YAML configuration file? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

    Correct Answer:

    Box 1: readinessProbe:

    For containerized applications that serve traffic, you might want to verify that your container is ready to handle incoming requests. Azure Container Instances supports readiness probes to include configurations so that your container can't be accessed under certain conditions.

    Incorrect Answers:

    livenessProbe: Containerized applications may run for extended periods of time, resulting in broken states that may need to be repaired by restarting the container. Azure Container Instances supports liveness probes so that you can configure your containers within your container group to restart if critical functionality is not working.

    Box 2: periodSeconds: 15 -

    The periodSeconds property designates the readiness command should execute every 15 seconds.

    Reference:

    https://docs.microsoft.com/en-us/azure/container-instances/container-instances-readiness-probe

Discussion
k8smaster

The readinessProbe is wrong. It clearly says "Initiate a shutdown if the pod is unresponsive." How can you iniate a shutdown (restart) with readinessProbe. It must have been livelinessProbe.

rdemontis

Agree with you. Here the question asks to initiate a shutdown if the pod is unresponsive. Shutdown means that the process will be killed and then restarted. It's different from a simple restart. "If the process in your container is able to crash on its own whenever it encounters an issue or becomes unhealthy, you do not necessarily need a liveness probe; the kubelet will automatically perform the correct action in accordance with the Pod's restartPolicy. If you'd like your container to be killed and restarted if a probe fails, then specify a liveness probe, and specify a restartPolicy of Always or OnFailure" https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes

Tranquillo1811

The real question is, what "Shutdown" actually means: a) restart the container b) remove the pod from the SLB

jperona

The correct answer is liveness because you want that your POD restart in case of failure. Readiness remove the POD from Load Balancer, but doesn't restart it. The kubelet uses liveness probes to know when to restart a container. For example, liveness probes could catch a deadlock, where an application is running, but unable to make progress. Restarting a container in such a state can help to make the application more available despite bugs. The kubelet uses readiness probes to know when a container is ready to start accepting traffic. A Pod is considered ready when all of its containers are ready. One use of this signal is to control which Pods are used as backends for Services. When a Pod is not ready, it is removed from Service load balancers.

d0bermannn

best comment here

Eltooth

Liveness Period seconds 15

Sara_Mo

The correct answer Box1: Liveness Probe Box2:Period seconds 15

yana_b

Readiness probe & period seconds:15

Vmwarevirtual

The provided answers are correct - check the definition regarding containers probe types - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes

syu31svc

https://docs.microsoft.com/en-us/azure/container-instances/container-instances-readiness-probe https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/ "readinessProbe Indicates whether the container is ready to respond to requests" "Confirm that the pod is responding to service requests" (From question) I would agree with the given answer

syu31svc

Sorry disregard my earlier answer Is liveness as per what the rest have mentioned

sondrex

1. livenessProbe: Ensures the container is running. If the liveness probe fails, Kubernetes will kill the container and restart it 2. initialDelaySeconds: 15

4bd3116

The correct answer is livenessProbe, and periodSeconds: 15 : apiVersion: v1 kind: Pod metadata: name: my-aks-pod spec: containers: - name: my-app-container image: my-app-image ports: - containerPort: 80 livenessProbe: httpGet: path: /healthz port: 80 initialDelaySeconds: 15 periodSeconds: 15 failureThreshold: 3

omerco61

I quote in microsoft official site; Readines Probes; For containerized applications that serve traffic, you might want to verify that your container is ready to handle incoming requests. liveness probes; Azure Container Instances supports liveness probes so that you can configure your containers within your container group to restart if critical functionality is not working. Answers; Liveness Probes Period Seconds; 15

Govcomm

liveness to reboot when the system is unresponsive. Readness is when the system ready to accepts the requests.

FeriAZ

Liveness Probes Period Seconds: 15

vsvaid

Liveness Probes Period Seconds; 15 Liveness Probes are used to check if the pod is responding or not. If not reboot. Readiness probe is used to check if the pod is ready to accept request.

sint822

livelinessProbe is correct. readinessProbe is for checking container dependencies and seeing if services are ready for serve request.

Fal991l

yaml code (GPT): livenessProbe: httpGet: path: /Server port: <port number> initialDelaySeconds: 15 periodSeconds: 15 timeoutSeconds: 15 failureThreshold: 4

ben_t

I agree with liveness probe, it is described here https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-setting-up-health-checks-with-readiness-and-liveness-probes But it is Microsoft tests and all will be possible. One can observe metadata where you can find the name of pod =) It is related to readyness.

UnknowMan

liveness is most appropriate (Kill the process)