kubectl + jq. No dependencies.

Explain why a Kubernetes object keeps changing

Your manual edit got overwritten again. kwhy traces the owner chain, identifies write managers and likely reconcilers, checks desired-state inputs, and tells you who's reverting your changes โ€” in one command.

View on GitHub Install
# Install
$ curl -L https://raw.githubusercontent.com/fizz/kwhy/main/kwhy -o /usr/local/bin/kwhy
$ chmod +x /usr/local/bin/kwhy

# Why does this deployment keep reverting?
$ kwhy explain deployment ml-pipeline-ui-artifact -n admin

Owner chain

Walks ownerReferences up to the root controller. Tells you whether you're editing a leaf that a parent will overwrite.

Write managers

Parses managedFields to show every actor that has written to the object โ€” controllers, operators, humans, CI pipelines.

Likely reconcilers

Uses annotation and manager heuristics to identify which controllers are actively reconciling. ArgoCD, Flux, Kubeflow, custom operators.

Desired-state inputs

Lists ConfigMap and Secret references that feed into the object. A change upstream can trigger a rollout you didn't expect.

Revert risk

Tells you whether a manual edit will stick or get overwritten on the next reconcile loop. Saves you the experiment.

RBAC sanity

Runs kubectl auth can-i checks to verify you have permission to edit what you're about to touch.