Cloud and Container Basics

In a web application on Kubernetes, the check performed by the liveness probe was made to include whether the application can connect to the database it depends on. Which of the following is the most likely problem with this setting?

  1. AWhen the database stops, the Pods are automatically moved to the node where the database runs, degrading the other applications on that node
  2. BA brief database outage makes the containers of all Pods restart repeatedly, delaying recovery even after the database comes back
  3. CWhen the liveness probe fails, the Pod is only removed from the Service's routing targets, so no particular problem arises
Show answer and explanation

Answer: B. A brief database outage makes the containers of all Pods restart repeatedly, delaying recovery even after the database comes back

A liveness probe exists to recover a container that has itself stopped responding (for example, through a deadlock) by restarting it. If it also checks a dependency, then when the database stops, the liveness probes of all Pods fail and the containers keep being restarted, even though restarting does not fix anything. During restarts no requests are handled, and the wait before the next restart may grow as restarts repeat, so recovery is delayed even after the database comes back. A liveness probe should check only whether the process itself can respond, and the state of dependencies should be handled by readiness probes or the application's error handling as needed.

  • A. A probe failure never moves a Pod to another node. When a liveness probe fails, the container is restarted.
  • B. Correct. A failure of a dependency causes the Pods to be restarted again and again.
  • C. Removing a Pod from the routing targets is what a readiness probe does. When a liveness probe fails, the container is restarted.
Practice this topic Back to topic

Books on Cloud and Container Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Cloud and Container Basics questions

  1. A Kubernetes HorizontalPodAutoscaler has a target CPU utilization of 70% and a range of 1 to 10 Pods. Currently the average CPU utilization of 5 Pods is 30%. When the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉ (⌈ ⌉ means rounding up), which of the following is the required number of Pods?
  2. In a Deployment whose Pod containers have the settings above, four Pods are running, each using 400m (0.4 cores) of CPU. The HorizontalPodAutoscaler's target CPU utilization is 60%, and the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉. Which of the following is the required number of Pods?
  3. In Kubernetes, which of the following correctly describes the resource requests and limits set for a container?
  4. A node has allocatable resources of 4 CPU cores and 8 GiB of memory. Each Pod's container has requests of 500m CPU and 1.5 GiB memory and limits of 1 CPU core and 2 GiB memory. There are no other Pods and no system reservations. Which of the following is the maximum number of Pods that can be placed on this node?
  5. A managed database service in the cloud (one in which the provider operates the database software) is used. Under the shared responsibility model, which of the following generally remains the user's responsibility?