Interview Prep/Kubernetes/Extending Kubernetes: Helm, CRDs, Operators & kubectl

How would you structure the status and conditions of a custom resource?

AdvancedConceptExtending Kubernetes: Helm, CRDs, Operators & kubectl
Answer

Follow the API convention: status.observedGeneration, and a conditions list of {type, status, reason, message, lastTransitionTime, observedGeneration}, with positive-polarity types like Ready and Available. Users and tooling (kubectl wait --for=condition=Ready) rely on it. Keep spec as desired state only and never let controllers write to spec.

All Kubernetes questions

More on Extending Kubernetes: Helm, CRDs, Operators & kubectl