Skip to content

Commit

Permalink
pkg/controller/daemon: Log misscheduled node
Browse files Browse the repository at this point in the history
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]: kubernetes/enhancements#120 (comment)
[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
  • Loading branch information
wking committed May 2, 2022
1 parent 5379417 commit 39be6f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/controller/daemon/daemon_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
}
}
Expand Down

0 comments on commit 39be6f8

Please sign in to comment.