What is Pod?

The smallest unit that Kubernetes places and runs. It groups one or more containers, which share a network namespace, including the IP address, and volumes, and can talk to each other over localhost. Usually it holds one application container, with helper containers added as needed. Pods are disposable and generally get a new name and IP address when recreated, so their number is kept by a Deployment or similar and a Service provides a stable endpoint for them.

Japanese name: Pod

Pod appears in 13 practice questions across 1 topic, including Cloud and Container Basics.

Field: Cloud and Container Basics

Try it: questions about Pod

In Kubernetes, a Deployment with replicas: 3 is running three Pods. Which of the following correctly describes what happens when one of these Pods is deleted with kubectl delete pod?

  1. AThe Deployment's setting is also rewritten to replicas: 2, and two Pods keep running
  2. BA controller detects that the actual number has fallen below the specified 3 and creates one new Pod
  3. CThe other two Pods of the Deployment are also deleted, and the whole Deployment stops
Show answer and explanation

Answer: B. A controller detects that the actual number has fallen below the specified 3 and creates one new Pod

In Kubernetes, users declare a desired state such as "run three Pods", and controllers repeatedly observe the actual state and act to bring it closer to the declaration when they differ (reconciliation). Deleting one Pod makes the actual number 2, so the ReplicaSet controller creates a new Pod to return to 3. When a Pod is lost because a node fails, the same mechanism recreates it on another node. To really reduce the number of Pods, change the Deployment's replicas instead of deleting Pods.

In a Kubernetes Deployment, the container image in the Pod template is changed to a new version. Which of the following correctly describes what happens with the default update strategy (RollingUpdate)?

  1. AA new ReplicaSet is created, and Pods of the new version are added while Pods of the old version are removed. The old ReplicaSet stays with 0 Pods for rollback
  2. BThe container image inside the running Pods is replaced with the new version in place without recreating the Pods, so neither the Pods' IP addresses nor their names change
  3. CAll Pods of the old version are deleted at once and then the Pods of the new version are created together, so the service stops temporarily during the update
Show answer and explanation

Answer: A. A new ReplicaSet is created, and Pods of the new version are added while Pods of the old version are removed. The old ReplicaSet stays with 0 Pods for rollback

When the Pod template changes, a Deployment creates a ReplicaSet for the new template and, while confirming that new Pods have become ready, gradually reduces the Pods of the old ReplicaSet. A certain number of Pods therefore keep handling requests during the update. The old ReplicaSet is kept with 0 Pods, so kubectl rollout undo can return to the previous version. The strategy that deletes all Pods first and then recreates them is Recreate, which is used only when specified explicitly.

Pod in the explanations

Questions that mention Pod (13)

  1. In Kubernetes, a Deployment with replicas: 3 is running three Pods. Which of the following correctly describes what happens when one of these Pods is deleted with kubectl delete pod?
  2. In a Kubernetes Deployment, the container image in the Pod template is changed to a new version. Which of the following correctly describes what happens with the default update strategy (RollingUpdate)?
  3. A Deployment with replicas: 10 has the rolling update settings maxSurge: 25% and maxUnavailable: 25%. Which of the following correctly gives the upper limit of the total number of Pods and the lower limit of the number of available Pods during an update?
  4. In Kubernetes, a Pod gets a different IP address every time it is recreated. Which of the following resources lets other applications connect, through a name and address that do not change, to several Pods selected by labels, with the load spread across them?
  5. A web application cannot handle requests for about 60 seconds after starting, while it loads its cache, and returns 503 from /ready during that time. Which of the following correctly describes the effect of adding the settings above to the Pod's container?
  6. 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?
  7. 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?
  8. 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?
  9. In Kubernetes, which of the following is the smallest unit that is deployed and managed, grouping one or more containers that share the same IP address and volumes?
  10. In a Kubernetes cluster, HTTPS requests arriving for one host name should be routed to the api Service if the path begins with /api, and to the web Service otherwise. Which of the following resources is suitable for defining this routing rule?
  11. A database password is stored in a Kubernetes Secret. Which of the following correctly describes a Secret?
  12. 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?
  13. In Kubernetes, which of the following correctly describes the resource requests and limits set for a container?

Books on Cloud and Container Basics Ad

As an Amazon Associate I earn from qualifying purchases.

Related terms

Kubernetes Container HTTP (Hypertext Transfer Protocol) Container image DNS (Domain Name System) Autoscaling TLS Reverse proxy Environment variable Deadlock

Back to the glossary