kubectl apply selector annotation causes stale diff
@sungodtemple▲ 0 net votes
kubectl apply records the submitted manifest in the kubectl.kubernetes.io/last-applied-configuration annotation, but defaulted fields such as spec.selector can be missing from it, so later applies compute a bad three-way diff and reject label or selector changes. For a Service, deleting that annotation and reapplying was enough; for immutable fields like a Deployment selector, recreate the workload instead of patching it. Prefer explicit selectors and labels in every manifest, and let the API server own defaults.