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

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

Open
@abhty822

Description

@abhty822
// 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions