Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
en:modul:m321_aws:topics:09 [2025/09/30 17:56] dgaravaldien:modul:m321_aws:topics:09 [2025/09/30 21:23] (aktuell) dgaravaldi
Zeile 1: Zeile 1:
-===== Pod Lifecycle =====+===== How Kubernetes "self-heals" ===== 
 +Let's first have an overview over the pieces of 'self-healing' mechanism by K8s.  
 + 
 +  - **Controllers** (Deployment → ReplicaSet → Pods): A Deployment declares the desired number of pod replicas. The ''ReplicaSet'' owned by that Deployment ensures that number is kept. If a pod is deleted or a pod’s container exits, the ''ReplicaSet'' (and controller manager) will create a replacement pod. 
 +  - **Restart Policy**: Container-level restarts are controlled by the Pod’s ''restartPolicy'' (for Deployments the value ''Always'' is set by default). If the container process exits, **kubelet** will restart it according to that policy. 
 +  - **Health checks** (so called **Probes**) 
 +      * **Liveness probe**: if it fails, kubelet will kill & restart the container (useful for recovering stuck processes). 
 +      * **Readiness probe**: controls whether a pod is considered "ready" and included in Services’ endpoints. During shutdown you should fail readiness, so the pod is removed from Service endpoints before termination. 
 +  - **Pod lifecycle**: When a pod is terminated (e.g., kubectl delete pod, node shutdown, or rolling update), Kubernetes sends ''SIGTERM'' to processes (pid 1) in the container, waits ''terminationGracePeriodSeconds'' (default 30s) for graceful exit, then ''SIGKILL''
 + 
 +\\ 
 +==== Pod Lifecycle ====
 Lifecycle and hooks that are offered for Pods (and Containers) are points where your code can take actions. Kubernetes offers a number of places where you can provide explicit feedback to the system to have it operate as you’d like. Lifecycle and hooks that are offered for Pods (and Containers) are points where your code can take actions. Kubernetes offers a number of places where you can provide explicit feedback to the system to have it operate as you’d like.
  
Zeile 12: Zeile 23:
   * **Succeeded (or) Failed**: The Pod has finished operation (normally or crashed)   * **Succeeded (or) Failed**: The Pod has finished operation (normally or crashed)
   * **Unknown**: It occurs fairly rare, and it's typically seen when there’s a problem internal to Kubernetes. In an example, K8s doesn’t know the current state of containers, or is unable to communicate with its underlying systems to determine that state   * **Unknown**: It occurs fairly rare, and it's typically seen when there’s a problem internal to Kubernetes. In an example, K8s doesn’t know the current state of containers, or is unable to communicate with its underlying systems to determine that state
 +\\
 ==== Probes ==== ==== Probes ====
    
  • en/modul/m321_aws/topics/09.1759247772.txt.gz
  • Zuletzt geändert: 2025/09/30 17:56
  • von dgaravaldi