Skip to content

Command · pk-metal

pk-metal render

changes no machineno cluster necessary

pk-metal render makes the Talos machine configuration of each node from files on your workstation. It does not talk to the cluster, to a BMC or to a machine.

pk-metal render --dir <manifests> --secrets <secrets.yaml|-> [flags]

The command takes no arguments.

FlagDefaultDescription
--credentials-ttl<duration>24h0m0sLifetime of the admin talosconfig and kubeconfig (at most 720h); they cannot be revoked short of a CA rotation.
--dir<string>required-Directory with TalosCluster/TalosNode (and patch ConfigMap) manifests.
--image-factory<string>factory.talos.devImage factory host the installer image is named on.
--no-credentialsfalseWrite the node configs only, no admin talosconfig or kubeconfig.
--out<string>clusterconfigOutput directory: <node>.yaml per node, talosconfig, kubeconfig.
--registerfalseTell the image factory about each schematic (needs network); off computes ids offline.
--secrets<file>required-Secrets bundle from talosctl gen secrets, or - for stdin.
  1. The command reads the manifests in --dir: one TalosCluster, its TalosNodes and the ConfigMaps with patches.
  2. It reads the secrets bundle. Make the bundle with talosctl gen secrets.
  3. It computes the installer image of each node from the schematic and the Talos version.
  4. It renders one machine configuration for each node, with the patches of the cluster and of the node.
  5. It writes the files into --out. It sets the mode of the directory to 0700 and of each file to 0600, also when they existed before. Only you can read the files.
File Content
<node>.yaml The machine configuration of one node.
talosconfig The administrator client configuration for talosctl. The certificate is valid for --credentials-ttl, 24 hours by default.
kubeconfig The administrator kubeconfig of the new cluster. The certificate is valid for --credentials-ttl.

With --no-credentials, the command writes the node configurations only. --credentials-ttl is 720 hours at most. Nobody can revoke these certificates without a rotation of the cluster CA. A short life limits the damage of a copy that leaks.

Without --register, the command computes the schematic id offline. The network is not necessary. With --register, it also sends each schematic to the image factory.

pk-metal render
talosctl gen secrets -o secrets.yaml
pk-metal render --dir manifests/ --secrets secrets.yaml
rendered 5 node configs, talosconfig and kubeconfig (valid 24h0m0s) for lab into clusterconfig
ls clusterconfig
cp-1.yaml  cp-2.yaml  cp-3.yaml  kubeconfig  talosconfig  w-1.yaml  w-2.yaml

Read the secrets bundle from stdin, for example from a secret store.

Terminal window
sops -d secrets.enc.yaml | pk-metal render --dir manifests/ --secrets - --out ~/clusterconfig

The command reads files, not objects in the cluster. The files have the same form as the objects:

File content Purpose
TalosCluster Versions, endpoint and cluster patches.
TalosNode Role, address, install disk, links and node patches.
ConfigMap The patches that the cluster and the nodes name. Each has the label os.platform-kit.org/patch.

In the cluster, the TalosNode controller renders the same configuration.

CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".