Key Kubernetes Concepts: Static Pods, Pod Lifecycle States, Creation Process, and Restart Policies
This article explains essential Kubernetes concepts, including the definition and management of static Pods, the possible lifecycle states of a Pod, the step‑by‑step process of creating a Pod, and the various restart policies and their controller constraints.
18. What is a static Pod in Kubernetes?
A static Pod is managed directly by the kubelet on a specific node, not via the API server, and cannot be associated with ReplicationController, Deployment, or DaemonSet; kubelet does not perform health checks on them. Static Pods are always created by the kubelet and run on its node.
19. What are the possible states of a Pod in Kubernetes?
Pending: API Server has created the Pod, but one or more container images are not yet created, including the image download process.
Running: All containers are created and at least one is running, starting, or restarting.
Succeeded: All containers have terminated successfully and will not be restarted.
Failed: All containers have terminated, and at least one exited with a failure status.
Unknown: The Pod state cannot be obtained, possibly due to network issues.
20. What is the main process for creating a Pod in Kubernetes?
The client submits the Pod configuration (e.g., a YAML file) to the kube‑apiserver.
The apiserver forwards the request to the controller‑manager to create a resource object.
The controller‑manager stores the Pod configuration in the etcd data store via the apiserver.
The kube‑scheduler detects the new Pod, filters unsuitable nodes, selects the best node, and sends the scheduling decision to the kubelet on that node.
The kubelet runs the Pod according to the scheduler’s assignment, reports the Pod’s status back, and the scheduler stores the status in etcd.
21. What are the restart policies for a Pod in Kubernetes?
RestartPolicy applies to all containers in a Pod and is evaluated by the kubelet on the node. The policies are Always (default), OnFailure, and Never.
Always: The kubelet restarts the container whenever it fails.
OnFailure: The kubelet restarts the container only if it exits with a non‑zero code.
Never: The kubelet never restarts the container, regardless of its exit status.
Restart policies are tied to controllers: ReplicationController and DaemonSet require Always; Job allows OnFailure or Never; kubelet will restart failed Pods regardless of the policy setting, and does not perform health checks on static Pods.
For more Kubernetes interview questions, see the series “Kubernetes 常见面试题汇总” (parts 1‑4) linked in the original article.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.