Configure a Kubernetes worker node with Talos Linux

Examine a detailed example of deploying a complete Kubernetes worker node on Talos Linux.

The generated configuration file created by talosctl has a lot of comments on how to configure each field, so it might be overwhelming for people to read through it all. The example that you will see here has the most used features configured. The list below has links to each of the additional features enabled in the config:

Full example configuration file (click to expand):

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
version: v1alpha1
debug: false
persist: true
machine:
    type: worker
    token: <TALOS_AUTO_GENERATED>

    ca:
        crt: <TALOS_AUTO_GENERATED>
        key: ""

    certSANs: []

    kubelet:
        image: ghcr.io/siderolabs/kubelet:v1.23.5

        extraArgs:
            rotate-server-certificates: true

        extraMounts:
            - destination: /var/mnt/storage
              type: bind
              source: /var/mnt/storage
              options:
                - bind
                - rshared
                - rw

        nodeIP:
            validSubnets:
                - 192.168.0.1/24

    network:
      hostname: example-agent-0
      interfaces:
        - interface: eth0
          addresses:
            - 192.168.0.242/24
          routes:
            - network: 0.0.0.0/0
              gateway: 192.168.0.1
          dhcp: true

      nameservers:
        - 192.168.0.1
        - 8.8.4.4
        - 8.8.8.8
        - 1.1.1.1

      extraHostEntries:
          - ip: 192.168.0.241
            aliases:
              - example-main-0
          - ip: 192.168.0.242
            aliases:
              - example-agent-0
          - ip: 192.168.0.243
            aliases:
              - example-agent-1

    install:
        disk: /dev/mmcblk0
        image: ghcr.io/siderolabs/installer:v1.0.1
        bootloader: true
        wipe: false

    features:
        rbac: true

    disks:
      - device: /dev/sda
        partitions:
          - mountpoint: /var/mnt/storage

    files:
      - content: |
          [metrics]
            address = "0.0.0.0:11234"          
        path: /var/cri/conf.d/metrics.toml
        op: create

    time:
        disabled: false
        servers:
            - time.cloudflare.com

    registries:
        config:
            registry.gitlab.com:
                auth:
                    username: example
                    password: secretpassword

cluster:
    id: <TALOS_AUTO_GENERATED>
    secret: <TALOS_AUTO_GENERATED>

    controlPlane:
        endpoint: https://192.168.0.250:6443

    network:
        dnsDomain: cluster.local
        podSubnets:
            - 10.244.0.0/16
        serviceSubnets:
            - 10.96.0.0/12

    token: <TALOS_AUTO_GENERATED>
    aescbcEncryptionSecret: ""

    ca:
        crt: <TALOS_AUTO_GENERATED>
        key: ""

    discovery:
        enabled: true
        registries:
            kubernetes: {}
            service: {}

The comments are removed in this example configuration, so as a reference, you can check the official configuration guide, or the initial auto generated file.

Remember, this can only serve you as an example on how a fully working Talos worker node is configured. You can see a detailed explanation about the enabled features by following the links above.