Direct answer
The update changes a field Kubernetes uses as stable identity. Revert that field or plan a controlled replacement.
Where this error appears
Kubernetes resource updates
Root cause
Common immutable fields include Deployment selectors, Service clusterIP, and several StatefulSet identity fields.
Minimal reproduction
# Existing selector
matchLabels:
app: api
# New selector
matchLabels:
app: backendCorrected example
# Keep the existing selector stable, or deploy a new resource name
matchLabels:
app: apiVerify the fix
kubectl diff -f manifest.yamlThings to check
- Deleting and recreating may cause downtime or replace generated addresses.
- Use a new resource name for intentional identity changes.
Authoritative reference
Confirm version-specific behavior in Kubernetes Deployments。