Guide on how to upgrade the Kubernetes cluster from Talos Linux.
talosctl upgrade-k8s
command.
This will automatically update the components needed to upgrade Kubernetes safely.
Upgrading Kubernetes is non-disruptive to the cluster workloads.
To trigger a Kubernetes upgrade, issue a command specifying the version of Kubernetes to ugprade to, such as:
talosctl --nodes <controlplane node> upgrade-k8s --to ${k8s_release}
Note that the --nodes
parameter specifies the control plane node to send the API call to, but all members of the cluster will be upgraded.
To check what will be upgraded you can run talosctl upgrade-k8s
with the --dry-run
flag:
To upgrade Kubernetes from run:
This command runs in several phases:
kube-proxy
daemonset with the new image version.kubelet
version is updated.
The command then waits for the kubelet
service to be restarted and become healthy.
The update is verified by checking the Node
resource state.
Note: The upgrade-k8s
command never deletes any resources from the cluster: they should be deleted manually.
If the command fails for any reason, it can be safely restarted to continue the upgrade process from the moment of the failure.
Note: When using custom/overridden Kubernetes component images, use flags --*-image
to override the default image names.
talosctl upgrade-k8s
command.
kubectl
config.
If you donβt already have one, you can get one by running:
talosctl patch
command:
.cluster.apiServer.image
key.
Also the machine configuration can be edited manually with talosctl -n <IP> edit mc --mode=no-reboot
.
Capture the new version of kube-apiserver
config with:
5
.
Wait for the new pod definition to propagate to the API server state (replace talos-default-controlplane-1
with the node name):
talosctl patch
command:
.cluster.controllerManager.image
key.
Capture new version of kube-controller-manager
config with:
3
.
Wait for the new pod definition to propagate to the API server state (replace talos-default-controlplane-1
with the node name):
talosctl patch
command:
.cluster.scheduler.image
key.
Capture new version of kube-scheduler
config with:
3
.
Wait for the new pod definition to propagate to the API server state (replace talos-default-controlplane-1
with the node name):
DaemonSet
, change:
DaemonSet
, run:
kubectl
with the following command:
Note: if some bootstrap resources were removed, they have to be removed from the cluster manually.
kubelet
restarts with the new configuration, confirm upgrade with kubectl get nodes <name>
: