En https://www.juanjosevalera.com/archivos/kubernetes-k0s-cluster-productivo-en-nas-qnap expliqué el proceso de instalación de k0s (realmente sencillo), y ahora toca hacerlo para el proceso de actualización.
Al igual que la instalación, la actualización es muy sencilla y parte de la edición del archivo k0sctl.yaml (bueno el nombre lo elijes tú). No voy a detallar todo el contenido de este archivo, si lo necesitas lo puedes consultar en la entrada mencionada arriba. Tan solo he cambiado la versión estableciendo ésta en la 1.27.3
$ diff k0sctl_20220226.yaml k0sctl_20230712.yaml
< version: 1.23.3+k0s.1
---
> version: 1.27.3+k0s.0
Una vez modificado el archivo de configuración tan solo queda instalar (k0sctl se dará cuenta que es una actualización).
$ ./k0sctl-linux-x64 apply --config k0sctl_20230712.yaml
⠀⣿⣿⡇⠀⠀⢀⣴⣾⣿⠟⠁⢸⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀█████████ █████████ ███
⠀⣿⣿⡇⣠⣶⣿⡿⠋⠀⠀⠀⢸⣿⡇⠀⠀⠀⣠⠀⠀⢀⣠⡆⢸⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀███ ███ ███
⠀⣿⣿⣿⣿⣟⠋⠀⠀⠀⠀⠀⢸⣿⡇⠀⢰⣾⣿⠀⠀⣿⣿⡇⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀███ ███ ███
⠀⣿⣿⡏⠻⣿⣷⣤⡀⠀⠀⠀⠸⠛⠁⠀⠸⠋⠁⠀⠀⣿⣿⡇⠈⠉⠉⠉⠉⠉⠉⠉⠉⢹⣿⣿⠀███ ███ ███
⠀⣿⣿⡇⠀⠀⠙⢿⣿⣦⣀⠀⠀⠀⣠⣶⣶⣶⣶⣶⣶⣿⣿⡇⢰⣶⣶⣶⣶⣶⣶⣶⣶⣾⣿⣿⠀█████████ ███ ██████████
k0sctl v0.13.2 Copyright 2021, k0sctl authors.
Anonymized telemetry of usage will be sent to the authors.
By continuing to use k0sctl you agree to these terms:
https://k0sproject.io/licenses/eula
INFO ==> Running phase: Connect to hosts
INFO [ssh] 192.168.2.71:22: connected
INFO [ssh] 192.168.2.72:22: connected
INFO [ssh] 192.168.2.73:22: connected
INFO ==> Running phase: Detect host operating systems
INFO [ssh] 192.168.2.71:22: is running Debian GNU/Linux 11 (bullseye)
INFO [ssh] 192.168.2.72:22: is running Debian GNU/Linux 11 (bullseye)
INFO [ssh] 192.168.2.73:22: is running Debian GNU/Linux 11 (bullseye)
INFO ==> Running phase: Acquire exclusive host lock
ERRO [ssh] 192.168.2.73:22: attempt 1 of 60.. trying to obtain a lock on host: removed existing expired lock file
ERRO [ssh] 192.168.2.72:22: attempt 1 of 60.. trying to obtain a lock on host: removed existing expired lock file
ERRO [ssh] 192.168.2.71:22: attempt 1 of 60.. trying to obtain a lock on host: removed existing expired lock file
INFO ==> Running phase: Prepare hosts
INFO ==> Running phase: Gather host facts
INFO [ssh] 192.168.2.71:22: using k0s-master as hostname
INFO [ssh] 192.168.2.71:22: discovered ens3 as private interface
INFO [ssh] 192.168.2.72:22: using k0s-node-1 as hostname
INFO [ssh] 192.168.2.73:22: using k0s-node-2 as hostname
INFO [ssh] 192.168.2.72:22: discovered ens3 as private interface
INFO [ssh] 192.168.2.73:22: discovered ens3 as private interface
INFO ==> Running phase: Validate hosts
INFO ==> Running phase: Gather k0s facts
INFO [ssh] 192.168.2.71:22: found existing configuration
INFO [ssh] 192.168.2.71:22: is running k0s controller version 1.27.3+k0s.0
INFO [ssh] 192.168.2.73:22: is running k0s worker version 1.23.3+k0s.1
WARN [ssh] 192.168.2.73:22: k0s will be upgraded
INFO [ssh] 192.168.2.71:22: checking if worker k0s-node-2 has joined
INFO [ssh] 192.168.2.72:22: is running k0s worker version 1.27.3+k0s.0
INFO [ssh] 192.168.2.71:22: checking if worker k0s-node-1 has joined
INFO ==> Running phase: Validate facts
INFO ==> Running phase: Configure k0s
INFO [ssh] 192.168.2.71:22: validating configuration
INFO ==> Running phase: Install workers
INFO [ssh] 192.168.2.72:22: validating api connection to https://192.168.2.71:6443
INFO [ssh] 192.168.2.73:22: validating api connection to https://192.168.2.71:6443
INFO [ssh] 192.168.2.71:22: generating token
INFO [ssh] 192.168.2.72:22: writing join token
INFO [ssh] 192.168.2.73:22: writing join token
INFO [ssh] 192.168.2.72:22: stopping service
INFO [ssh] 192.168.2.72:22: installing k0s worker
INFO [ssh] 192.168.2.72:22: starting service
INFO [ssh] 192.168.2.72:22: waiting for node to become ready
INFO [ssh] 192.168.2.73:22: stopping service
INFO [ssh] 192.168.2.73:22: installing k0s worker
INFO [ssh] 192.168.2.73:22: starting service
INFO [ssh] 192.168.2.73:22: waiting for node to become ready
INFO ==> Running phase: Upgrade workers
INFO Upgrading 1 workers in parallel
INFO [ssh] 192.168.2.73:22: upgrade starting
INFO [ssh] 192.168.2.73:22: waiting for node to become ready again
INFO [ssh] 192.168.2.73:22: upgrade successful
INFO ==> Running phase: Release exclusive host lock
INFO ==> Running phase: Disconnect from hosts
INFO ==> Finished in 15m1s
INFO k0s cluster version 1.27.3+k0s.0 is now installed
INFO Tip: To access the cluster you can now fetch the admin kubeconfig using:
INFO k0sctl kubeconfig
Durante la instalación / actualización se pueden comprobar los cambios que sufren los nodos del cluster. La foto final indica que los dos nodos se encuentran en Ready con la versión deseada v1.27.3
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k0s-node-1 Ready <none> 501d v1.23.3+k0s
k0s-node-2 Ready,SchedulingDisabled <none> 501d v1.23.3+k0s
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k0s-node-1 Ready <none> 501d v1.27.3+k0s
k0s-node-2 Ready,SchedulingDisabled <none> 501d v1.23.3+k0s
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k0s-node-1 Ready <none> 501d v1.27.3+k0s
k0s-node-2 Ready <none> 501d v1.23.3+k0s
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k0s-node-1 Ready <none> 501d v1.27.3+k0s
k0s-node-2 Ready <none> 501d v1.23.3+k0s
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
k0s-node-1 Ready <none> 501d v1.27.3+k0s
k0s-node-2 Ready <none> 501d v1.27.3+k0s
Bueno y si esperabas algo más complejo (tal y como pasa en otras implementaciones de kubernetes), no lo hay. Así de sencillo!