Skip to content

Commit

Permalink
feat: unschedulable node health check
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Jun 3, 2024
1 parent 5817d26 commit 5a3e11e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/health/health_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ func getNodeHealth(obj *unstructured.Unstructured) (*HealthStatus, error) {
return nil, fmt.Errorf("failed to convert unstructured Node to typed: %v", err)
}

for _, taint := range node.Spec.Taints {
if taint.Key == "node.kubernetes.io/unschedulable" && taint.Effect == "NoSchedule" {
return &HealthStatus{
Ready: false,
Health: HealthWarning,
Status: HealthStatusWarning,
}, nil
}
}

for _, cond := range node.Status.Conditions {
if cond.Type == v1.NodeReady && cond.Status == v1.ConditionTrue {
return &HealthStatus{
Expand Down

0 comments on commit 5a3e11e

Please sign in to comment.