Skip to content

Tutorial

First real server

In the virtual lab, the machines are simulated BMCs and virtual machines. In this tutorial you use one real server. At the end, the server runs Talos as a cluster with one control plane.

Time
About one hour. The install takes about ten minutes.
Hardware
One x86-64 server in UEFI boot mode, with a Redfish BMC that has the license for virtual media. One free static address for the node. See Supported hardware.
Network
Your workstation reaches the BMC on TCP 443. The BMC reaches your workstation on TCP 30443. The node reaches the internet.
BMC network
The BMC downloads the installer and the config from the media service of the operator. The operator downloads the installer from factory.talos.dev. See The BMC and the image factory.
Tools
A Linux workstation with Docker Engine and a clone of the repository. mise install gives you kind, kubectl and talosctl. eval "$(mise activate bash)" puts them on the PATH. Stage 1 builds pk-metal.
Knowledge
Read Your first cluster in the lab first. This tutorial uses the same steps.
  1. Build the tool, and put it on your PATH.

    Terminal window
    mise run build && export PATH=$PWD/metal/bin:$PATH
  2. Put the BMC password in the environment.

    Terminal window
    read -rs PK_METAL_BMC_PASSWORD && export PK_METAL_BMC_PASSWORD
  3. Check the BMC.

    Terminal window
    pk-metal check --insecure https://192.0.2.21
  4. Count the media: lines that do not show dialect=none. One such line means a BMC with one slot.

  5. Read the inventory into a file.

    Terminal window
    pk-metal inventory --insecure --node cp-1 https://192.0.2.21 > cp-1-inventory.yaml
  6. Write down these values: the serial number, the BMC MAC, the node NIC MAC and the install disk serial.

Checkpoint. The last line of the check is check: OK (read-only). See Check a BMC to read the other lines.

This stage is a short form of Install the operator. That page explains each file.

  1. Copy lab/kind.yaml to kind.yaml. Set listenAddress to the address of your workstation on the BMC network.

  2. Make the kind cluster.

    Terminal window
    kind create cluster --config kind.yaml
  3. Build the operator image. The last line of the output is the image reference, for example pk-metal:4f0c2d1a9b3e.

    Terminal window
    mise run image
  4. Load the image into kind. Use your image reference.

    Terminal window
    kind load docker-image pk-metal:4f0c2d1a9b3e --name pk-metal
  5. Copy the sample overlay.

    Terminal window
    cp -r metal/config/samples/site-overlay overlay
  6. In overlay/kustomization.yaml, set the base to ../metal/config/default. Set images to newName: pk-metal and newTag to your tag.

  7. In overlay/manager_args.yaml, set --media-url=https://<workstation address>:30443.

  8. In overlay/ledger.yaml, write one line: the BMC MAC and https://192.0.2.21. Delete the example lines.

  9. Decide how the manager checks the BMC certificate. See BMC certificates. For this first test on a closed BMC network, you can remove --bmc-ca-secret=bmc-ca. The manager then pins the key that the BMC shows at the first contact.

  10. If the BMC has one slot, remove the comment marks from components in overlay/kustomization.yaml.

  11. Apply the overlay.

    Terminal window
    kubectl apply --server-side -k overlay

Checkpoint. kubectl -n pk-metal get pods shows the manager as Running.

  1. Make the credentials Secret.

    Terminal window
    kubectl -n pk-metal create secret generic bmc-factory \
    --from-literal=username=admin --from-literal=password="$PK_METAL_BMC_PASSWORD"
  2. Write and apply the Asset, with the serial and the BMC MAC from stage 1.

    Terminal window
    kubectl apply -f asset.yaml
  3. Monitor the Host.

    Terminal window
    kubectl get hosts -w

Checkpoint. One Host is Available. If it shows Mismatch, see Host in Mismatch. If no Host comes and kubectl get managementendpoints shows Unreachable, the cause is usually the BMC certificate. See BMC unreachable.

  1. Make the secrets bundle and put it into a Secret.

    Terminal window
    talosctl gen secrets -o secrets.yaml
  2. Make the Secret from the file.

    Terminal window
    kubectl -n pk-metal create secret generic first-talos-secrets --from-file=secrets.yaml
  3. Write a TalosCluster first. Use the node address as the endpoint. Set controlPlane.allowScheduling: true, so that pods can run on the one node.

  4. Write a TalosNode cp-1 with the role controlplane, the disk serial and the NIC MAC from stage 1.

  5. Apply both files.

    Terminal window
    kubectl apply -f first.yaml
  6. Wait until the operator rendered the config.

    Terminal window
    kubectl wait --for=condition=Rendered talosnode/cp-1 --timeout=120s

Checkpoint. The command prints talosnode.os.platform-kit.org/cp-1 condition met. See Define a cluster for the fields.

Install one machine

1 / 5

A HostClaim binds a Host. A HostOperation, after approval, boots the machine through its BMC with virtual media.YouHostClaimPendingHostOperation-BMCRedfishHostAvailableMedia storeinstaller + configMachineoffbindsproposesapprovesRedfishmountspower cyclechecks in

Claim

You apply a HostClaim. The HostClaim controller binds a free Host to it.

kubectl apply -f claim.yaml
  1. Claim. You apply a HostClaim. The HostClaim controller binds a free Host to it.

    kubectl apply -f claim.yaml
  2. Propose. The controller proposes a HostOperation. The operation waits for approval. The machine does not change.

    pk-metal status
  3. Approve. You approve the operation. The HostOperation controller starts it.

    pk-metal approve install-node-01
  4. Boot. The operation mounts the installer and the node configuration as virtual media. It sets a one-time boot device and power cycles the machine.

    InsertMedia → SetBootOverride → PowerCycle
  5. Check in. Talos starts from the disk and the node checks in. The operation ejects the media and succeeds. The Host is Provisioned.

    AwaitCheckIn → EjectMedia
  1. Write a HostClaim cp-1 with the Asset and spec.os.nodeRef.name: cp-1.

  2. Apply it as a member of the admin group. Only that group can apply a claim that installs a node, and the kind admin is not a member.

    Terminal window
    kubectl apply --as="$USER" --as-group=pk-metal:admins --as-group=system:authenticated -f claim.yaml

    This command uses impersonation. It is a shortcut for a test cluster of your own. On a production cluster, your login gives you the group. See The admin group and the approvers.

  3. List the operations that wait. Without a name, the command approves nothing.

    Terminal window
    pk-metal approve
  4. Read the plan of the install and approve it. Use the name from the list. Type y when the command asks.

    Terminal window
    pk-metal approve pk-metal/<name>

    The operator proposed the install, so you can approve it.

  5. Monitor the Host and the serial console of the server.

    Terminal window
    kubectl get hosts -w

Checkpoint. The Host is Provisioned. kubectl get taloscluster first shows AVAILABLE True.

  1. Write the kubeconfig to a file.

    Terminal window
    kubectl -n pk-metal get secret first-kubeconfig -o jsonpath='{.data.kubeconfig}' | base64 -d > first.kubeconfig
  2. Show the node.

    Terminal window
    kubectl --kubeconfig first.kubeconfig get nodes

Checkpoint. cp-1 is Ready.

What you see Go to
The manager pod is not Running If it fails of the install how-to
The endpoint is Unreachable BMC unreachable
The operation fails at insertMedia Media slot busy or missing, and The BMC and the image factory
The Host stays Provisioning, and the console shows no boot Node not ready, and the boot mode in Supported hardware
The operation is Failed Operation failed