Skip to content

Commit 34b8832

Browse files
authored
Merge pull request kubernetes#125631 from SergeyKanzhelev/logFailedAdmission
improve logging of pod admission denied
2 parents 4093c35 + e8e2fda commit 34b8832

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
@@ -2275,6 +2275,9 @@ func (kl *Kubelet) canAdmitPod(pods []*v1.Pod, pod *v1.Pod) (bool, string, strin
22752275
}
22762276
for _, podAdmitHandler := range kl.admitHandlers {
22772277
if result := podAdmitHandler.Admit(attrs); !result.Admit {
2278+
2279+
klog.InfoS("Pod admission denied", "podUID", attrs.Pod.UID, "pod", klog.KObj(attrs.Pod), "reason", result.Reason, "message", result.Message)
2280+
22782281
return false, result.Reason, result.Message
22792282
}
22802283
}

0 commit comments

Comments
 (0)