Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

【提问】pkg/kubelet/kubelet.go 中 syncpod函数内apiPodStatus和existingStatus #31

Open
abhty822 opened this issue Aug 20, 2020 · 0 comments

Comments

@abhty822
Copy link

// Generate final API pod status with pod and status manager status
apiPodStatus := kl.generateAPIPodStatus(pod, podStatus)
...
// Record the time it takes for the pod to become running.
existingStatus, ok := kl.statusManager.GetPodStatus(pod.UID)

看了注释仍然不清晰这两个podStatus有什么作用
初步查看了代码有一下发现
1、apiPodStatus依赖于cache中的数据,而cache中的数据来自于PLEG周期获取宿主机上容器的状态
2、existingStatus通过statusManager获取,而statusManager的数据主要来自上面两段代码的之后一段代码

// Update status in the status manager
kl.statusManager.SetPodStatus(pod, apiPodStatus)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant