Skip to content

Commit

Permalink
Merge pull request kubernetes#125631 from SergeyKanzhelev/logFailedAd…
Browse files Browse the repository at this point in the history
…mission

improve logging of pod admission denied
  • Loading branch information
k8s-ci-robot committed Jun 29, 2024
2 parents 4093c35 + e8e2fda commit 34b8832
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion pkg/kubelet/cm/topologymanager/topology_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ func (m *manager) RemoveContainer(containerID string) error {
}

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

startTime := time.Now()
Expand Down
2 changes: 0 additions & 2 deletions pkg/kubelet/eviction/eviction_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ func (m *managerImpl) Admit(attrs *lifecycle.PodAdmitAttributes) lifecycle.PodAd
}
}

// reject pods when under memory pressure (if pod is best effort), or if under disk pressure.
klog.InfoS("Failed to admit pod to node", "pod", klog.KObj(attrs.Pod), "nodeCondition", m.nodeConditions)
return lifecycle.PodAdmitResult{
Admit: false,
Reason: Reason,
Expand Down
3 changes: 3 additions & 0 deletions pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,9 @@ func (kl *Kubelet) canAdmitPod(pods []*v1.Pod, pod *v1.Pod) (bool, string, strin
}
for _, podAdmitHandler := range kl.admitHandlers {
if result := podAdmitHandler.Admit(attrs); !result.Admit {

klog.InfoS("Pod admission denied", "podUID", attrs.Pod.UID, "pod", klog.KObj(attrs.Pod), "reason", result.Reason, "message", result.Message)

return false, result.Reason, result.Message
}
}
Expand Down

0 comments on commit 34b8832

Please sign in to comment.