From 39be6f85acf52ec25bb0d1c80ad847f9dc87cb09 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 26 Apr 2022 15:27:23 -0700 Subject: [PATCH] pkg/controller/daemon: Log misscheduled node So administrators have some idea at how to debug, when they notice that status.numberMisscheduled > 0, e.g. because KubeDaemonSetMisScheduled is firing. Ideally we'd have status.conditions on DaemonSet [1], so we could declare things like this in a more discoverable location. But while logs aren't all that discoverable, they are easier to add than a new DaemonSet property. And we can mitigate discoverability by filling out [2] and linking [3] a runbook to recommend grepping the controller logs for this message. [1]: https://github.com/kubernetes/enhancements/issues/120#issuecomment-252856758 [2]: https://github.com/kubernetes-monitoring/kubernetes-mixin/blob/5c2dd2c63c8d655bdb7717f695d02bd22bd180e8/runbook.md#alert-name-kubedaemonsetmisscheduled [3]: https://github.com/kubernetes-monitoring/kubernetes-mixin/blob/5c2dd2c63c8d655bdb7717f695d02bd22bd180e8/alerts/apps_alerts.libsonnet#L224-L237 --- pkg/controller/daemon/daemon_controller.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/controller/daemon/daemon_controller.go b/pkg/controller/daemon/daemon_controller.go index e31dde1eaccdc..ef05d97349060 100644 --- a/pkg/controller/daemon/daemon_controller.go +++ b/pkg/controller/daemon/daemon_controller.go @@ -1147,6 +1147,7 @@ func (dsc *DaemonSetsController) updateDaemonSetStatus(ctx context.Context, ds * } } else { if scheduled { + klog.V(2).InfoS("Found misscheduled daemon set pod", "daemonSet", klog.KObj(ds), "node", node.Name) numberMisscheduled++ } }