k8s - pod life cycle

First on the map, look at the life cycle through the pod map

After kubectl call to create the command pod, pod will go through several stages, along with plans to go

As shown, the pod containers which will have n

1. init container (initial container of)

Each container can hold some of the first container (init container), the primary purpose of container in running some preparation before the real container, such as copying files, for the first time of the file, or get some sensitive fields such as passwords, keys and so on. Why do it? There are several points

  • a. Assume that each container with some commands which are copies of the tools, such as zip, or other tools crul, will cause each container size increases, because these tools unzip the like, in which the container is not used to run after such tools become redundant, so hope to complete all the work in the first of a container put the container is closed.
  • b. Since the start of real container which is not access to sensitive fields of space, so after the initial of the vessel will be able to get the required sensitive fields, giving them to the main tank, so there is no security of the main container problem.
  • C. Note here that, the first container is a synchronous operation, performed sequentially, performing a first container of the first container failure is not of the first into the second container.
  • d. There is also related to the start of the first container policy

 

2. start (starting container)

After completion of the initial execution of all the containers, it will all be killed, and then the main container will be activated

 

3. readiness (probe)

During startup, will be with the probe, the purpose is to check whether the vessel started successfully, if successful, will be exposed to the service port

 

4. liveness (survival)

Throughout the process will check the viable state of a main container

 

5. stop (stop the container )

Finally, the container is stopped, there must be stopped or artificial controller stops

Guess you like

Origin www.cnblogs.com/oscar1987121/p/12218855.html