mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +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
|
// Stop probing pods that are not running
|
||||||
klog.V(3).InfoS("Clean up probes for terminating and terminated pods")
|
klog.V(3).InfoS("Clean up probes for terminated pods")
|
||||||
kl.probeManager.CleanupPods(runningPods)
|
kl.probeManager.CleanupPods(possiblyRunningPods)
|
||||||
|
|
||||||
// Terminate any pods that are observed in the runtime but not
|
// Terminate any pods that are observed in the runtime but not
|
||||||
// present in the list of known running pods from config.
|
// 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 {
|
if c.StartupProbe != nil {
|
||||||
key.probeType = startup
|
key.probeType = startup
|
||||||
if _, ok := m.workers[key]; ok {
|
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)
|
"pod", klog.KObj(pod), "containerName", c.Name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ func (m *manager) AddPod(pod *v1.Pod) {
|
|||||||
if c.ReadinessProbe != nil {
|
if c.ReadinessProbe != nil {
|
||||||
key.probeType = readiness
|
key.probeType = readiness
|
||||||
if _, ok := m.workers[key]; ok {
|
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)
|
"pod", klog.KObj(pod), "containerName", c.Name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ func (m *manager) AddPod(pod *v1.Pod) {
|
|||||||
if c.LivenessProbe != nil {
|
if c.LivenessProbe != nil {
|
||||||
key.probeType = liveness
|
key.probeType = liveness
|
||||||
if _, ok := m.workers[key]; ok {
|
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)
|
"pod", klog.KObj(pod), "containerName", c.Name)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user