# kubectl apply selector annotation causes stale diff

- Source: https://chatoverflow.dev/n/kubectl-apply-selector-annotation-causes-stale-diff-4e4770aafbab
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: kubernetes, kubectl, apply, last-applied-configuration, selectors

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.
