---
title: "Install Talos Linux for Kubernetes"
sidebar_label: "Install Talos Linux for Kubernetes"
sidebar_position: 8
description: "How to install Talos Linux on a dedicated server to work with Kubernetes"
---

import Formbricks from '@theme/MDXComponents/Formbricks'

# Install Talos Linux for Kubernetes

Talos Linux is a specialized operating system developed by Sidero Labs and designed for running Kubernetes.

It runs in the server's RAM and uses the latest stable Talos version from official releases — more details on the [Releases](https://github.com/siderolabs/talos/releases) page in the Sidero Labs GitHub repository.

You can connect to a server with Talos via [VNC](/dedicated/manage/connect-to-server.mdx#connect-via-vnc) or via the [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).

1. [Prepare parameters for cluster node configuration](#prepare-cluster-node-parameters).
2. [Prepare the cluster node configuration](#prepare-cluster-node-configuration).
3. [Apply the configuration to the Control Plane node](#apply-configuration-to-control-plane-node).
4. [Apply the configuration to the Worker node](#apply-configuration-to-worker-nodes).
5. [Initialize Kubernetes](#initialize-kubernetes).

## 1. Prepare parameters for cluster node configuration \{#prepare-cluster-node-parameters}

To prepare the configuration files for the Control Plane and Worker nodes, you need to collect the parameters for each server that will be part of the cluster.

1. [Boot the server into Rescue recovery and diagnostics mode](/dedicated/troubleshooting/boot-to-recovery.mdx).

2. [Connect to the server via SSH](/dedicated/manage/connect-to-server.mdx#connect-via-ssh) or via the [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).

3. Output information about the network configuration:

   ```bash
   ip a && ip r
   ```

   The output will contain information about the network interfaces. Copy and save the network parameters. For example:

   ```bash
   2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
       link/ether 1c:1b:0d:65:43:21 brd ff:ff:ff:ff:ff:ff
       altname eno1
       altname enp4s0f0
       altname enxac1f6b47814a
       inet 203.0.113.10/24 brd 203.0.113.255 scope global eth0

   default via 203.0.113.1 dev eth0
   203.0.113.0/24 dev eth0 proto kernel scope link src 203.0.113.10
   ```

   Where:

   * `203.0.113.10` is the server public IP address. The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → **IP address**;
   * `203.0.113.1` — default gateway;
   * `/24` — subnet mask;
   * `1c:1b:0d:65:43:21` — MAC address of the network interface.

4. Select the disk to install the Talos OS to. To do this, list the disks:

   ```bash
   lsblk
   ```

   The output will contain information about the disks. Copy and save the name of the disk you will install the OS on. For example:

   ```bash
   NAME  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
   loop0   7:0    0 547.9M  1 loop /run/archiso/airootfs
   sda     8:0    0 447.1G  0 disk
   sdb     8:16   0 447.1G  0 disk
   sdc     8:32   0   3.6T  0 disk
   sdd     8:48   0   3.6T  0 disk
   ```

5. Change the server boot template. You can:

   * restore the [previous server boot template](/dedicated/troubleshooting/boot-to-recovery.mdx#restore-server-boot-template) or reboot the server from the OS. When rebooting the server from the OS, the boot template will automatically change to the one that was set before the server was booted in Rescue mode;
   * or boot the server directly in Talos mode to continue installing Talos Linux.

6. Repeat steps 1-5 for each server in the cluster.

## 2. Prepare the cluster node configuration \{#prepare-cluster-node-configuration}

1. Ensure that the [`talosctl`](https://docs.siderolabs.com/talos/v1.13/getting-started/talosctl) client is installed on the server from which you will install the Talos OS.

2. Create a base cluster configuration:

   ```bash
   talosctl gen config my-cluster https://<ip_address>:6443
   ```

   Specify `<ip_address>` — the public IP address of the Control Plane server that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**.

   The output will contain information about successful configuration generation. For example:

   ```bash
   generating PKI and tokens
   created controlplane.yaml
   created worker.yaml
   created talosconfig
   ```

   Where:

   * `controlplane.yaml` — configuration template for the Control Plane node;
   * `worker.yaml` — configuration template for Worker nodes;
   * `talosconfig` — configuration for the `talosctl` client.

3. Create a patch file for the Control Plane node:

   3.1. Create a patch file for the Control Plane node using the `vi` text editor:

   ```bash
   vi <file_name>
   ```

   Specify `<file_name>` — the name of the file in `yaml` format, for example `patch-cp1.yaml`.

   3.2. Add the configuration to the file:

   ```bash
   cluster:
       allowSchedulingOnControlPlanes: true
   machine:
       install:
           disk: /dev/<disk>
       network:
           interfaces:
           - deviceSelector:
                   hardwareAddr: "<mac_address>"
               addresses:
                   - <ip_address>/<mask>
               routes:
                   - network: 0.0.0.0/0
                   gateway: <gateway>
               dhcp: false
           nameservers:
               - <dns_server>
   ```

   Specify:

   * `<disk>` — the name of the disk to install the Talos OS on, which you selected in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<mac_address>` — the MAC address of the network interface you saved in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<ip_address>` — the public IP address of the server that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**;
   * `<mask>` — the subnet mask you saved in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<gateway>` — default gateway you saved in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<dns_server>` — the IP address of the DNS server. You can add multiple DNS servers. We recommend using [recursive Selectel DNS servers](/infrastructure/dns/dns-recursive-servers-list.mdx), but you can specify any available DNS servers.

   3.3. Exit the `vi` text editor, saving your changes:

   ```bash
   :wq
   ```

4. If the cluster uses multiple servers, create a configuration for the Worker node. For a single server (Single Node Cluster), you can skip creating configurations for Worker nodes.

   4.1. Create a patch file for the Worker node using the `vi` text editor:

   ```bash
   vi <file_name>
   ```

   Specify `<file_name>` — the name of the file in `yaml` format, for example `patch-worker1.yaml`.

   4.2. Add the configuration to the file:

   ```bash
   machine:
   install:
       disk: /dev/<disk>
   network:
       interfaces:
       - deviceSelector:
               hardwareAddr: "<mac_address>"
           addresses:
               - <ip_address>/<mask>
           routes:
               - network: 0.0.0.0/0
               gateway: <gateway>
           dhcp: false
       nameservers:
           - <dns_server>
   ```

   Specify:

   * `<disk>` — the name of the disk to install the Talos OS on, which you selected in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<mac_address>` — the MAC address of the network interface you saved in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<ip_address>` — the public IP address of the server that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**;
   * `<mask>` — the subnet mask you saved in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<gateway>` — default gateway you saved in step 3 while [preparing parameters in stage 1](#prepare-cluster-node-parameters);
   * `<dns_server>` — the IP address of the DNS server. You can add multiple DNS servers. We recommend using [recursive Selectel DNS servers](/infrastructure/dns/dns-recursive-servers-list.mdx), but you can specify any available DNS servers.

   4.3. Exit the `vi` text editor, saving your changes:

   ```bash
   :wq
   ```

   4.4. If you plan to have a cluster of multiple servers, repeat steps 4.1-4.3 to create separate patch files for each Worker node.

## 3. Apply the configuration to the Control Plane node \{#apply-configuration-to-control-plane-node}

1. [Boot the Control Plane server into Rescue recovery and diagnostics mode with the Talos template](/dedicated/troubleshooting/boot-to-recovery.mdx).

2. [Connect to the server via VNC](/dedicated/manage/connect-to-server.mdx#connect-via-vnc) or via the [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).

3. Ensure the server is in Maintenance mode:

   ```bash
   STAGE: Maintenance
   ```

4. Apply the Control Plane node configuration:

   ```bash
   talosctl apply-config \
       --insecure \
       -e <ip_address> \
       -n <ip_address> \
       --file controlplane.yaml \
       --config-patch @<file_name>
   ```

   Specify:

   * `<ip_address>` — the public IP address of the Control Plane server that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**;
   * `<file_name>` — the Control Plane patch file you created in step 3 while [preparing the cluster node configuration in stage 2](#prepare-cluster-node-configuration), for example `patch-cp1.yaml`.

   After applying the configuration, you will receive the response `Applied configuration without a reboot`, and the server will enter `STAGE: Installing`.

5. Wait for the OS installation to complete — the server will automatically reboot and enter `KUBELET: Healthy`.

## 4. Apply the configuration to the Worker node \{#apply-configuration-to-worker-nodes}

1. [Boot the Worker server into Rescue recovery and diagnostics mode with the Talos template](/dedicated/troubleshooting/boot-to-recovery.mdx).

2. [Connect to the server via VNC](/dedicated/manage/connect-to-server.mdx#connect-via-vnc) or via the [KVM console](/dedicated/manage/connect-to-server.mdx#connect-via-kvm-console).

3. Ensure the server is in Maintenance mode:

   ```bash
   STAGE: Maintenance
   ```

4. Apply the Worker node configuration:

   ```bash
   talosctl apply-config \
       --insecure \
       -e <ip_address> \
       -n <ip_address> \
       --file worker.yaml \
       --config-patch @<file_name>
   ```

   Specify:

   * `<ip_address>` — the public IP address of the Worker node that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**;
   * `<file_name>` — the Worker node patch file you created in step 4 while [preparing the cluster node configuration in stage 2](#prepare-cluster-node-configuration), for example `patch-worker1.yaml`.

   After applying the configuration, you will receive the response `Applied configuration without a reboot`, and the server will enter `STAGE: Installing`.

5. Wait for the OS installation to complete — the server will automatically reboot and enter `KUBELET: Healthy`.

## 5. Initialize Kubernetes \{#initialize-kubernetes}

1. Create a Kubernetes cluster:

   ```bash
   talosctl bootstrap \
       --nodes <ip_address> \
       --endpoints <ip_address> \
       --talosconfig ./talosconfig
   ```

   Specify `<ip_address>` — the public IP address of the Control Plane server that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**.

2. Get the configuration file for managing the Kubernetes cluster:

   ```bash
   talosctl kubeconfig \
       --nodes <ip_address> \
       --endpoints <ip_address> \
       --talosconfig ./talosconfig
   ```

   Specify `<ip_address>` — the public IP address of the Control Plane server that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**.

   The Kubernetes configuration file is saved by default at `~/.kube/config`.

3. Check the status of the Kubernetes nodes:

   ```bash
   kubectl get nodes -o wide
   ```

   The output will contain information about node statuses. For example:

   ```bash
   NAME            STATUS   ROLES           VERSION
   talos-lv9-t5t   Ready    control-plane   v1.36.0
   talos-xc9-jfu   Ready    <none>          v1.36.0
   talos-ee2-e9f   Ready    <none>          v1.36.0
   ```

   All nodes must have the `Ready` status.

4. Check the system pods:

   ```bash
   kubectl get pods -A
   ```

   The output will contain information about the pod statuses. For example:

   ```bash
   NAMESPACE     NAME                                        READY   STATUS    RESTARTS   AGE
   kube-system   kube-apiserver-talos-lv9-t5t                1/1     Running   0          5m
   kube-system   kube-controller-manager-talos-lv9-t5t       1/1     Running   0          5m
   kube-system   kube-scheduler-talos-lv9-t5t                1/1     Running   0          5m
   kube-system   coredns-xxxxxxxxxx-xxxxx                    1/1     Running   0          5m
   ```

   Core system pods must have the `Running` status.

5. Check the list of cluster participants:

   ```bash
   talosctl \
       --talosconfig ./talosconfig \
       -e <ip_address> \
       -n <ip_address> \
       get members
   ```

   Specify `<ip_address>` — the public IP address of the Control Plane server that you saved in step 3 when [preparing parameters in phase 1](#prepare-cluster-node-parameters). The dedicated server IP address can also be viewed in the [Control Panel](https://my.selectel.ru/servers/default/servers/): in the top menu, select **Products** → **Dedicated Servers** → **Servers** → server card → field **IP address**.

   The output will contain information about the cluster nodes. For example:

   ```bash
   NODE            NAMESPACE   TYPE     ID              VERSION   HOSTNAME        MACHINE TYPE   OS                ADDRESSES
   203.0.113.10    cluster     Member   talos-ee2-e9f   1         talos-ee2-e9f   worker         Talos (v1.13.0)   ["203.0.113.12"]
   203.0.113.10    cluster     Member   talos-lv9-t5t   1         talos-lv9-t5t   controlplane   Talos (v1.13.0)   ["203.0.113.11"]
   203.0.113.10    cluster     Member   talos-xc9-jfu   2         talos-xc9-jfu   worker         Talos (v1.13.0)   ["203.0.113.10"]
   ```

   Ensure that all servers are present in the list and have the correct roles.

<Formbricks />
