talosctl CLI utility.
The upgrade API call passes a node the installer image to use to perform the upgrade.
Each Talos version has a corresponding installer image, listed on the release page for the version, for example v1.15.0-beta.0.
Upgrades use an A-B image scheme in order to facilitate rollbacks.
This scheme retains the previous Talos kernel and OS image following each upgrade.
If an upgrade fails to boot, Talos will roll back to the previous version.
Likewise, Talos may be manually rolled back via API (or talosctl rollback), which will update the boot reference and reboot.
Note An upgrade of the Talos Linux OS will not (since v1.0) apply an upgrade to the Kubernetes version by default.
Kubernetes upgrades should be managed separately per upgrading kubernetes.
Supported upgrade paths
Because Talos Linux is image based, an upgrade is almost the same as installing Talos, with the difference that the system has already been initialized with a configuration. The supported configuration may change between versions. The upgrade process should handle such changes transparently, but this migration is only tested between adjacent minor releases. Thus the recommended upgrade path is to always upgrade to the latest patch release of all intermediate minor releases. For example, the recommended path from Talos 1.13 to v1.15.0-beta.0 is:- Upgrade to the latest 1.13 patch release, v1.13.13.
- Upgrade to the latest 1.14 patch release, v1.14.7.
- Upgrade to v1.15.0-beta.0.
Before upgrade to v1.15.0-beta.0
The following changes in Talos 1.15 can affect existing machines.Multipath configuration
multipath.conf provided is a minimal configuration that works for most setups; if you have a custom configuration, update the contents field accordingly as per your requirements.
The patch removes the old extension service configuration and creates the host file that multipathd waits for and bind-mounts read-only.
containerd configuration version 4
Talos 1.15 uses version 4 of thecontainerd configuration format, which moves the [metrics], [grpc], [ttrpc] and [debug] server settings into plugin sections.
A CRICustomizationConfig document or system extension that sets them in the old sections stops working after the upgrade, without an error.
Other settings, such as registry and runtime configuration, are unchanged.
The settings moved as follows:
The
[debug] level, format and log_trace_id settings stay at the top level.
The ttrpc address is no longer derived from the grpc address, so a customized grpc address needs a matching ttrpc address.
The following customization enables the containerd metrics endpoint in version 3:
IPVS kernel modules
In Talos 1.15, IPVS is built as kernel modules, which aren’t loaded at boot. Without them,kube-proxy in IPVS mode fails to start with can't use the IPVS proxier: Ipvs not supported.
When kube-proxy runs in IPVS mode, load ip_vs and the module of the scheduler in use with KernelModuleConfig documents.
The scheduler modules are ip_vs_rr, ip_vs_wrr, ip_vs_lc, ip_vs_sh and ip_vs_mh.
The following documents load the modules for the default round-robin scheduler:
Video walkthrough
To see a live demo of an upgrade of Talos Linux, see the video below:After upgrade to v1.15.0-beta.0
An upgrade replaces Talos on the machine but keeps its machine configuration. Some Talos 1.15 changes apply right after the upgrade. Others are turned on in the machine configuration, so they apply only after the configuration is updated. The following changes apply right after the upgrade:- Kubelet image garbage collection: The kubelet
imageGCHighThresholdPercentnow defaults to 75 andimageGCLowThresholdPercentto 65, instead of the upstream 85 and 80, unless either is set in the kubelet configuration. After the upgrade, nodes with disk usage above 75% remove unused images. - Redacted resources: More resource types are now marked sensitive.
talosctl1.15 reads them with any role and shows the sensitive values asREDACTED, while an oldertalosctlneeds theos:adminrole to read them. - Time check API:
talosctl time --checkis no longer available to theos:readerrole.
- trustd certificate check: trustd certificates now carry a trustd-specific extended key usage.
The new
.machine.features.trustdCheckExtKeyUsagesetting makes worker nodes accept only these certificates, and it is enabled by default in worker configuration generated by Talos 1.15. On existing clusters, enable it on worker nodes only after all control plane nodes run Talos 1.15, otherwise the worker nodes fail to refresh their Talos API certificates. - Disk SMART status: Configuration generated by Talos 1.15 includes a DiskSMARTConfig document, which enables SMART status collection. Upgraded clusters don’t have the document, so collection stays off until it is added.
- KubePrism readiness check: The readiness check of KubePrismConfig is enabled by default only for configuration generated by Talos 1.15.
Upgraded clusters keep the TCP check until
readinessCheckis set.
talosctl upgrade
To upgrade a Talos node, specify the node’s IP address and the Talos version to upgrade to.
For nodes running Talos 1.14 or later that were installed from the Image Factory, talosctl detects the installer image of each node and keeps its Image Factory host, schematic, platform and SecureBoot setting.
Nodes with different images can be upgraded with one command.
The following command upgrades the node at 10.20.30.40 to Talos v1.15.0-beta.0:
--talos-version defaults to the talosctl version.
To keep the node on its current Talos version, set --talos-version to that version.
To change the schematic, for example to add a system extension, set --schematic-id:
--image-factory-host and --secure-boot change the Image Factory host and the SecureBoot setting.
For a node that wasn’t installed from the Image Factory, set both --schematic-id and --image-factory-host, or set --image.
To upgrade to a specific installer image, set --image.
--image can’t be combined with the flags above, and it is required for nodes running Talos versions before 1.14:
Installer images are served by the Image Factory as factory.talos.dev/metal-installer/<schematic-id>:<version>.
Use the schematic ID of the image the node was installed from, which includes its system extensions, or the empty schematic 376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba for a machine without customizations.
Talos Linux reboots via the kexec syscall, which skips the firmware, so the extra reboot adds very little time.
On machines with SecureBoot enabled, Talos Linux doesn’t use kexec, and the machine reboots through its firmware instead, so each reboot takes as long as a full boot.
Machine configuration changes
Talos 1.15 adds new configuration documents and settings, and deprecates onev1alpha1 field.
A machine configuration written for Talos 1.14 keeps working after the upgrade.
Deprecated fields
.machine.seccompProfiles is deprecated in favor of SeccompProfileConfig documents, one document per profile.
The deprecated field keeps working, but a SeccompProfileConfig document can’t reuse the name of a profile declared in it.
New configuration documents
Talos 1.15 adds the following configuration documents:- CPUPartitionConfig: Declares the host CPUs each Talos workload root may run on.
- CPUScalingConfig: Configures CPU frequency scaling for the matched cores.
- DiskSMARTConfig: Enables SMART status collection from disks.
- KubeAuthenticationWebhookConfig: Configures kube-apiserver webhook token authentication.
- MacVLANConfig: Creates MACVLAN links.
- NetworkLinkIngressConfig: Filters incoming packets on a link by destination address.
- SeccompProfileConfig: Declares a named seccomp profile.
- StaticEndpointsConfig: Provides a static list of control plane endpoints.
- VXLANConfig: Creates VXLAN links.
- WorkloadResourceConfig: Sets aggregate memory limits for Kubernetes pods, Talos containers, and virtual machines.
Upgrade sequence
When a Talos node receives the upgrade command, it cordons itself in Kubernetes, to avoid receiving any new workload. It then starts to drain its existing workload. NOTE: If any of your workloads are sensitive to being shut down ungracefully, be sure to use thelifecycle.preStop Pod spec.
Once all of the workload Pods are drained, Talos will start shutting down its
internal processes.
Once all the processes are stopped and the services are shut down, the filesystems will be unmounted.
This allows Talos to produce a very clean upgrade, as close as possible to a pristine system.
We verify the disk and then perform the actual image upgrade.
We set the bootloader to boot once with the new kernel and OS image, then we reboot.
After the node comes back up and Talos verifies itself, it will make
the bootloader change permanent, rejoin the cluster, and finally uncordon itself to receive new workloads.
FAQs
Q. What happens if an upgrade fails? A. Talos Linux attempts to safely handle upgrade failures. The most common failure is an invalid installer image reference. In this case, Talos will fail to download the upgraded image and will abort the upgrade. Sometimes, Talos is unable to successfully kill off all of the disk access points, in which case it cannot safely unmount all filesystems to effect the upgrade. In this case, it will abort the upgrade and reboot. It is possible (especially with test builds) that the upgraded Talos system will fail to start. In this case, the node will be rebooted, and the bootloader will automatically use the previous Talos kernel and image, thus effectively rolling back the upgrade. Lastly, it is possible that Talos itself will upgrade successfully, start up, and rejoin the cluster but your workload will fail to run on it, for whatever reason. This is when you would use thetalosctl rollback command to revert back to the previous Talos version.
Q. Can upgrades be scheduled?
A. Because the upgrade sequence is API-driven, you can easily tie it in to your own business logic to schedule and coordinate your upgrades.
Q. Can the upgrade process be observed?
A. Yes, using the talosctl dmesg -f command.
You can also use talosctl upgrade --wait, and optionally talosctl upgrade --wait --debug to observe kernel logs
Q. Are worker node upgrades handled differently from control plane node upgrades?
A. Short answer: no.
Long answer: Both node types follow the same set procedure.
From the user’s standpoint, however, the processes are identical.
However, since control plane nodes run additional services, such as etcd, there are some extra steps and checks performed on them.
For instance, Talos will refuse to upgrade a control plane node if that upgrade would cause a loss of quorum for etcd.
If multiple control plane nodes are asked to upgrade at the same time, Talos will protect the Kubernetes cluster by ensuring only one control plane node actively upgrades at any time, via checking etcd quorum.
Q. Can I break my cluster by upgrading everything at once?
A. Possibly - it’s not recommended.
Nothing prevents the user from sending near-simultaneous upgrades to each node of the cluster - and while Talos Linux and Kubernetes can generally deal with this situation, other components of the cluster may not be able to recover from more than one node rebooting at a time.
(e.g. any software that maintains a quorum or state across nodes, such as Rook/Ceph)
Q. Which version of talosctl should I use to update a cluster?
A. We recommend using the version that matches the current running version of the cluster.