Upgrading MicroK8s

Hi there, I’m slightly confused w.r.t. these docs about how to proceed to upgrade my 3 node cluster from 1.30/stable to 1.31/stable while keeping the cluster running. Or is that simply not a realistic option?

My confusion centers around the fact that it seems that it’s recommended to disable addons and then re-enable them post upgrade. But DNS, vital for running the cluster, is a ‘core addon’. Disabling the dns addon will as far as I know disable dns for the whole cluster, rendering it inoperable at least while doing the upgrade for all nodes.

The “detailed how to for upgrading a 3 node cluster” seems to completely ignore the whole addon situation, which according to this documentation would lead to a new k8s version with old and perhaps incompatible ‘addons’ which you might not be able to remove due to the addon scripts being updated alongside the snap.

As my cluster is for learning I just tried it. The disabling didn’t really go smoothly with some errors popping up (while I’m running microk8s “from the tutorial”, on Ubunutu server 24.04.01)

jelle@lenovo-03:~$ microk8s disable dns
Infer repository core for addon dns
Disabling DNS
Reconfiguring kubelet
Removing DNS manifest
deployment.apps "coredns" deleted
pod/coredns-5986966c54-849x7 condition met
serviceaccount "coredns" deleted
configmap "coredns" deleted
service "kube-dns" deleted
clusterrole.rbac.authorization.k8s.io "coredns" deleted
clusterrolebinding.rbac.authorization.k8s.io "coredns" deleted
[sudo] password for jelle: 
Removing argument --cluster-domain from nodes.
Removing argument --cluster-dns from nodes.
Restarting nodes.
The connection to the server 127.0.0.1:16443 was refused - did you specify the right host or port?
Failed to list nodes (try 1): Command '['/snap/microk8s/7398/microk8s-kubectl.wrapper', 'get', 'node', '-o', 'json']' returned non-zero exit status 1.
DNS is disabled

After this I can indeed see that dns is disabled on all three nodes, and pods are no longer running properly (as one might expect), e.g. in argocd

Failed to load target state: failed to generate manifest for source 1 of 1: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial tcp: lookup argocd-repo-server: i/o timeout"