I'm in the process of upgrading a cluster to Kubernetes v1.16. There are some notes about deprecations in that update. One of those notes is that a the apiVersion
extensions/v1beta1
for Deployment
is removed, and that one should use the apiVersion
apps/v1
prior to upgrading.
That sounds simple enough, yet I cannot figure out how to actually effect that change.
We updated the YAML file to include the newer apiVersion
; that is, the YAML file containing our Deployment
starts with,
apiVersion: apps/v1
kind: Deployment
However, if we kubectl apply
this to our server, and then kubectl get deployment -o yaml
it back, to verify the change, it hasn't updated; the apiVerison
reported by the server is still:
apiVersion: extensions/v1beta1
kind: Deployment
metadata
annotations:
[...]
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion": "apps/v1", ...}
I included the metadata.annotations
field here; you can see the annotation from kubectl
that even acknowledges that it is applying a manifest with the correct apiVersion
, yet the resource still comes back with the old version!
The linked deprecation notice also talks about using kubectl convert
; we've also tried that. AFAICT, kubectl convert
just works on offline YAML representations of the resource, and even kubectl apply
-ing the result of kubectl convert
doesn't change the above behavior.
I've also tried kubectl patch
to patch that specific field, but again, verifying it indicates that no actual change happens. (The output from kubectl patch
also says that nothing changed.)
How do I actually update the in-Kubernetes version of this resource?
(Some minor notes: this cluster is an Azure AKS instance; Azure actually flagged this resource as needing attention.)