Why am I getting an error when I try to change the apiVersion
of a deployment via kubectl edit deployment example
?
Do I have to delete and recreate the object?
You're getting this because there are only certain attributes of a resource that you may change once it's created. ApiVersion, Kind, and Name are some of the prime identifiers of a resource so they can't be changed without deleting/recreating them.