Skip to content

Day 1

Define a cluster

Make the operator render a Talos machine config for each node of a new cluster.

  1. Make the secrets bundle. Keep the file secret.

    Terminal window
    talosctl gen secrets -o secrets.yaml
  2. Put the bundle into a Secret in pk-metal. The key must be secrets.yaml.

    Terminal window
    kubectl -n pk-metal create secret generic prod-talos-secrets --from-file=secrets.yaml
  3. Put a copy of the file into your secret store. Then remove the plain file.

    Terminal window
    rm secrets.yaml

    The bundle has the CA keys of the cluster. Without a copy, the Secret in the management cluster is the only one. Bootstrap without the operator and pk-metal render need the file again. See Credentials.

  4. Write the TalosCluster.

    cluster.yaml
    apiVersion: os.platform-kit.org/v1alpha1
    kind: TalosCluster
    metadata:
    name: prod
    spec:
    talosVersion: v1.14.6
    kubernetesVersion: v1.36.2
    endpoint: https://192.0.2.100:6443
    controlPlane:
    vip: 192.0.2.100
    secretsRef:
    namespace: pk-metal
    name: prod-talos-secrets
    schematic:
    customization:
    extraKernelArgs:
    - console=ttyS1,115200n8
  5. Write one TalosNode for each machine. Select the install disk by its serial.

    cp-1.yaml
    apiVersion: os.platform-kit.org/v1alpha1
    kind: TalosNode
    metadata:
    name: cp-1
    spec:
    clusterRef:
    name: prod
    role: controlplane
    installDiskSelector:
    serial: SIM-DISK-0001
    network:
    links:
    - name: lan
    hardwareAddr: "02:00:48:0b:80:01"
    addresses:
    - 192.0.2.11/24
    routes:
    - gateway: 192.0.2.1
  6. Apply the files.

    Terminal window
    kubectl apply -f cluster.yaml -f nodes/
  7. Wait until the operator rendered each config.

    Terminal window
    kubectl wait --for=condition=Rendered talosnode --all --timeout=120s

Without a patch, Talos uses public DNS and NTP servers. A closed site blocks them, and then a node does not become ready. Add the two patches to spec.patches of the TalosCluster.

cluster.yaml
spec:
patches:
- inline: |
apiVersion: v1alpha1
kind: ResolverConfig
nameservers:
- address: 192.0.2.53
- inline: |
apiVersion: v1alpha1
kind: TimeSyncConfig
ntp:
servers:
- ntp.example.org

If the cluster has only control planes, set spec.controlPlane.allowScheduling: true on the TalosCluster. Without it, ordinary pods have no node. The operator also needs such a node after a pivot.

The fields of a TalosNode describe plain links. For a VLAN or a bond, add a Talos document as a patch of the TalosNode. A link of spec.network.links is the parent. The patch uses the name of the link.

A VLAN on the link lan
spec:
patches:
- inline: |
apiVersion: v1alpha1
kind: VLANConfig
name: lan.120
vlanID: 120
parent: lan
addresses:
- address: 198.51.100.11/24
A bond of two links, on a worker
spec:
network:
links:
- name: lan1
hardwareAddr: "02:00:48:0b:80:01"
- name: lan2
hardwareAddr: "02:00:48:0b:80:02"
patches:
- inline: |
apiVersion: v1alpha1
kind: BondConfig
name: bond0
links: [lan1, lan2]
bondMode: 802.3ad
addresses:
- address: 192.0.2.11/24
routes:
- gateway: 192.0.2.1
  • The renderer accepts the two examples, and Talos validation passes. They are not tested on a machine.
  • A control plane with a VIP needs a static address in the subnet of the VIP on a link of spec.network.links. A bond patch cannot supply that address.
  • The Talos documentation has all fields of VLANConfig and BondConfig.
Terminal window
kubectl get talosnodes -o custom-columns='NAME:.metadata.name,RENDERED:.status.conditions[?(@.type=="Rendered")].status'

Each node shows True. Nothing changes on a machine until you claim it.

Condition on the TalosNode Fix
Rendered=False, SecretsUnavailable The Secret is missing or has no key secrets.yaml. Do step 2 again.
Rendered=False, ClusterNotFound spec.clusterRef.name names no TalosCluster.
Rendered=False, RenderFailed The message has the Talos validation error. Correct the patch or the field.
Rendered=False, UnsupportedVersionPair Talos does not support this Kubernetes version. Change one of the two versions.