Interview Prep/Kubernetes/Helm, operators and GitOps

A custom resource is stuck in Terminating. Why?

AdvancedScenarioHelm, operators and GitOps
Answer

Situation read → kubectl delete hangs on a custom resource.

What I'd do →

  1. kubectl get cr x -o yaml and inspect metadata.finalizers and deletionTimestamp
  2. The operator is expected to remove the finalizer after cleanup
  3. Check whether the operator is running: kubectl get pods -n operators
  4. Fix the operator and let it finish cleanup
  5. Last resort: kubectl patch cr x --type=merge -p '{"metadata":{"finalizers":[]}}' knowing external resources may leak

Why → A finalizer holds the object until its controller completes cleanup.

Interview tip → Say you patch finalizers only after confirming what cleanup is skipped.

All Kubernetes questions Roadmap: Platform engineering

More on Helm, operators and GitOps