Kubernetes Detailed Explanation (14) - Pod Object Life Cycle

Today, I will continue to introduce the relevant knowledge of Linux operation and maintenance. The main content of this article is the Pod object life cycle.

1. Overview of the Pod object declaration cycle

The entire process of a Pod object from being created to being terminated is called the life cycle of a Pod object. During this time, the Pod object may be in various states and perform certain operations. The main container is created when the Pod container must perform operations during the creation process, and the remaining optional operations include initializing the container, hook functions after the container starts, container liveness detection, container readiness detection, and hooks before container termination function and so on. Whether or not these operations will be performed depends on the Pod's definition.
The life cycle diagram of the Pod object is as follows:
insert image description here

2. The running status of the Pod object

In the Pod, there is a PodStatus object in the status field, and there is a phase field in the object, which reflects the state of the Pod. Whether it is a manually created Pod or a Pod created through Deployment, the Pod object is always in one of the following stages:
1. Pending
At this point, the API Server has created the Pod object and stored it in ETCD, but The Pod object has not been scheduled, or the image file of its container is still being downloaded.
2. Running (Running)
Pod has been scheduled to a node, and all containers have been created.
3. Succeeded
All containers in the Pod have been terminated successfully and will not be restarted.
4. Failed (Failured)
All containers in the Pod are stopped, but some containers are terminated due to execution failure. That is, the Pod exits due to a non-zero status or is banned by the system.
5. Unknown (Unknown)
The API Server cannot obtain the status information of the Pod object, which may be caused by the inability to communicate with the kubelet running the Pod.
The schematic diagram of the Pod stage is as follows:
insert image description here
Originality is not easy, please indicate the source for reprinting: https://blog.csdn.net/weixin_40228200

Guess you like

Origin blog.csdn.net/weixin_40228200/article/details/124286666