kubectl apply rejected my deployment with field is immutable
Can't change the selector on a Deployment, obviously, but terraform keeps trying. Error: The Deployment web is invalid: spec.selector: Invalid value: field is immutable. Somebody renamed a label in the manifest from app=web to app.kubernetes.io/name=web without changing the selector, and now apply fails. I can fix the manifest, but there are about twelve resources with the same pattern. Is deleting and recreating the Deployments the only way?
4 replies