Skip to content

[FEATURE] Emit Kubernetes Events for rule evaluation and taint failures #408

Description

@vishnukothakapu

Is your feature request related to a problem or existing issue? Please describe.

I noticed in nodereadinessrule_controller.go that an EventRecorder is initialized in NewRuleReadinessController, but a quick grep shows it is never actually used to emit events (Event, Eventf).

When a rule fails to evaluate against a node or a taint fails to apply, the error is only printed to the controller's stdout logs. Standard Kubernetes practice is to emit an EventTypeWarning on the NodeReadinessRule (and possibly the Node) so users can easily see failures via kubectl describe nodereadinessrule <name> or kubectl get events.

Describe the solution you'd like

Add r.Controller.EventRecorder.Eventf(...) calls for major lifecycle events and failures.
For example:

  • Normal: "TaintApplied" / "TaintRemoved"
  • Warning: "EvaluationFailed" / "TaintApplyFailed"

Describe alternatives you've considered

Forcing users to scrape controller logs or rely entirely on Prometheus metrics, but kubectl describe is usually the first line of defense for users debugging why a node isn't ready.

Metadata

Metadata

Labels

kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions