Skip to content

Commit e8e2fda

Browse files
improve logging of pod admission denied
1 parent bdbd87b commit e8e2fda

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pkg/kubelet/cm/topologymanager/topology_manager.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ func (m *manager) RemoveContainer(containerID string) error {
212212
}
213213

214214
func (m *manager) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAdmitResult {
215-
klog.InfoS("Topology Admit Handler", "podUID", attrs.Pod.UID, "podNamespace", attrs.Pod.Namespace, "podName", attrs.Pod.Name)
216215
metrics.TopologyManagerAdmissionRequestsTotal.Inc()
217216

218217
startTime := time.Now()

pkg/kubelet/eviction/eviction_manager.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ func (m *managerImpl) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAd
172172
}
173173
}
174174

175-
// reject pods when under memory pressure (if pod is best effort), or if under disk pressure.
176-
klog.InfoS("Failed to admit pod to node", "pod", klog.KObj(attrs.Pod), "nodeCondition", m.nodeConditions)
177175
return lifecycle.PodAdmitResult{
178176
Admit: false,
179177
Reason: Reason,

pkg/kubelet/kubelet.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,6 +2325,9 @@ func (kl *Kubelet) canAdmitPod(pods []*v1.Pod, pod *v1.Pod) (bool, string, strin
23252325
}
23262326
for _, podAdmitHandler := range kl.admitHandlers {
23272327
if result := podAdmitHandler.Admit(attrs); !result.Admit {
2328+
2329+
klog.InfoS("Pod admission denied", "podUID", attrs.Pod.UID, "pod", klog.KObj(attrs.Pod), "reason", result.Reason, "message", result.Message)
2330+
23282331
return false, result.Reason, result.Message
23292332
}
23302333
}

0 commit comments

Comments
 (0)