Value
Description
Pending
Pod 已被 Kubernetes 系統接受,但有一個或者多個 container image 尚未被建立完成。這一段時間包含了調度 Pod 的時間和通過網絡下載 image 的時間,需要一段時間來處理
Running
Pod 已經綁定到某個 node 上,相關的 container 都已經建立完成;且至少有個 container 正在運行 or 正處於 starting or restarting 的狀態下
Succeeded
Pod 中的所有 container 都被成功終止,並且不會再重啟
Failed
Pod 中的所有 container 都被終止,但至少有一個因為任務失敗而終止(表示退出時的狀態碼不為 0 or 被系統終止)
Unknown
因為某些原因無法取得 Pod 的狀態,通常是因為與 Pod 所在 node 通訊失敗
apiVersion:v1 kind:Pod metadata: labels: test:liveness name:liveness-http spec: containers: -args: -/server image:k8s.gcr.io/liveness livenessProbe: httpGet: # when "host" is not defined, "PodIP" will be used # host: my-host # when "scheme" is not defined, "HTTP" scheme will be used. Only "HTTP" and "HTTPS" are allowed # scheme: HTTPS path:/healthz port:8080 httpHeaders: -name:X-Custom-Header value:Awesome initialDelaySeconds:15 timeoutSeconds:1 name:liveness
readinessProbe: 診斷 pod 是否可以接受 service request。若診斷沒有通過,與這個 pod 相關的 service endpoint 資訊都會被 controller 移除。在 initial delay 之前 readiness 狀態會被預設為 failure。此外,如果 pod spec 中沒有提供 readinessProbe 的設定,則預設為診斷成功。