Rat*_*sal 8 kubernetes kubernetes-pod
我想知道在 Kubernetes 中启动我的 pod 需要多长时间。我的 Pod 有3 Init Containers和9 actual Containers。到目前为止,这是我尝试过的:
AGEinkubectl describe pod <pod_name>将给出启动时间的想法。kubectl events使用或查看 pod 的事件kubectl describe。问题是并非所有容器都存在事件。此外,没有明确的方法来了解 pod 处于READY状态所需的时间。问: Kubernetes 是否提供了确定整个 Pod 启动时间的方法?
Jed*_*edi 11
随着事情开始设置,您的 pod 将通过一组PodConditions进行。
你可以使用:
kubectl get po <pod_name> -o yaml
Run Code Online (Sandbox Code Playgroud)
观察这些不同条件下的进展:
...
conditions:
- lastProbeTime: null
lastTransitionTime: "2020-09-09T08:47:11Z"
status: "True"
type: Initialized
- lastProbeTime: null
lastTransitionTime: "2020-09-09T08:47:12Z"
status: "True"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2020-09-09T08:47:12Z"
status: "True"
type: ContainersReady
- lastProbeTime: null
lastTransitionTime: "2020-09-09T08:47:11Z"
status: "True"
type: PodScheduled
...
Run Code Online (Sandbox Code Playgroud)
如果您想在 shell 中自动解析所有这些,我建议您yq
进行实际的 YAML 解析。
| 归档时间: |
|
| 查看次数: |
12322 次 |
| 最近记录: |