mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
kubelet: only shutdown probes for pods that are terminated
This fixes a bug where terminating pods would not run their readiness probes. Terminating pods are found within the possiblyRunningPods map.
This commit is contained in:
parent
1d518adb76
commit
f25ca15e1c
@ -1105,8 +1105,8 @@ func (kl *Kubelet) HandlePodCleanups() error {
|
||||
}
|
||||
|
||||
// Stop probing pods that are not running
|
||||
klog.V(3).InfoS("Clean up probes for terminating and terminated pods")
|
||||
kl.probeManager.CleanupPods(runningPods)
|
||||
klog.V(3).InfoS("Clean up probes for terminated pods")
|
||||
kl.probeManager.CleanupPods(possiblyRunningPods)
|
||||
|
||||
// Terminate any pods that are observed in the runtime but not
|
||||
// present in the list of known running pods from config.
|
||||
|
@ -163,7 +163,7 @@ func (m *manager) AddPod(pod *v1.Pod) {
|
||||
if c.StartupProbe != nil {
|
||||
key.probeType = startup
|
||||
if _, ok := m.workers[key]; ok {
|
||||
klog.ErrorS(nil, "Startup probe already exists for container",
|
||||
klog.V(4).ErrorS(nil, "Startup probe already exists for container",
|
||||
"pod", klog.KObj(pod), "containerName", c.Name)
|
||||
return
|
||||
}
|
||||
@ -175,7 +175,7 @@ func (m *manager) AddPod(pod *v1.Pod) {
|
||||
if c.ReadinessProbe != nil {
|
||||
key.probeType = readiness
|
||||
if _, ok := m.workers[key]; ok {
|
||||
klog.ErrorS(nil, "Readiness probe already exists for container",
|
||||
klog.V(4).ErrorS(nil, "Readiness probe already exists for container",
|
||||
"pod", klog.KObj(pod), "containerName", c.Name)
|
||||
return
|
||||
}
|
||||
@ -187,7 +187,7 @@ func (m *manager) AddPod(pod *v1.Pod) {
|
||||
if c.LivenessProbe != nil {
|
||||
key.probeType = liveness
|
||||
if _, ok := m.workers[key]; ok {
|
||||
klog.ErrorS(nil, "Liveness probe already exists for container",
|
||||
klog.V(4).ErrorS(nil, "Liveness probe already exists for container",
|
||||
"pod", klog.KObj(pod), "containerName", c.Name)
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user