Issue a talosconfig
Mint the owner's os:admin talosconfig for a Talos cluster and Rowbutt's os:reader one, and store each in 1Password.
Use this runbook when a cluster moves to Talos, and before a talosconfig certificate expires. A talosconfig is the client certificate and endpoints that talosctl uses to reach the Talos API. Its certificate lasts one year.
| 1Password item | Type and file name | Holds |
|---|---|---|
talos-<site>-secrets | Secure Note | The cluster's secrets bundle, which Atlantis reads |
talos-<site>-admin | Document, talosconfig | The owner's os:admin talosconfig, with one context named <site> |
talos-rowbutt-reader | Document, talosconfig | Rowbutt's os:reader talosconfig, with a context for each Talos cluster |
<site> is folly or offsite, and <checkout> is a checkout of this repository.
Before you start#
- You need
talosctl,jq,yqandop, signed in to thehomelabvault. - The item
talos-<site>-secretsexists.
Issue the admin talosconfig#
warning
The Talos API cannot revoke a client certificate. Keep the files out of the repository, and delete them after the upload.
Go to a new directory under
/dev/shm.Mint the
os:adminfile from the cluster's secrets bundle.topology=<checkout>/clusters/<site>/config/cluster-topology.json op read "op://homelab/talos-<site>-secrets/notesPlain" > secrets.yaml talosctl gen config --with-secrets secrets.yaml --output-types talosconfig -o admin \ <site> "https://$(jq -r .data.API_SERVER_HOSTNAME "$topology"):6443"Result:
Created admin.Set its endpoint and node to
API_SERVER_IP.ip=$(jq -r .data.API_SERVER_IP "$topology") talosctl --talosconfig admin --context <site> config endpoint "$ip" talosctl --talosconfig admin --context <site> config node "$ip"If the item
talos-<site>-adminexists, delete it.Store the file as the Document
talos-<site>-admin.op document create admin --title talos-<site>-admin --file-name talosconfig --vault homelabDelete the directory.
Add the context to your workstation, as Get cluster admin access describes.
Issue the Rowbutt talosconfig#
Go to a new directory under
/dev/shm.For each cluster that runs Talos, mint an
os:readerfile with your admin context, and merge it intoreader.config newnames its contextreader@<site>, so rename it to<site>before the merge.ip=$(jq -r .data.API_SERVER_IP <checkout>/clusters/<site>/config/cluster-topology.json) talosctl --context <site> config new --roles os:reader --crt-ttl 8760h reader-<site> yq -i '.context = "<site>" | .contexts = {"<site>": .contexts["reader@<site>"]}' reader-<site> talosctl --talosconfig reader config merge reader-<site> talosctl --talosconfig reader --context <site> config endpoint "$ip"Make sure that
readerhas one context for each cluster that runs Talos.talosctl --talosconfig reader config contextsResult: One row for each such cluster, named
follyoroffsite.If the item
talos-rowbutt-readerexists, delete it.Store
readeras the Documenttalos-rowbutt-reader.op document create reader --title talos-rowbutt-reader --file-name talosconfig --vault homelabDelete the directory.
Make sure that the ExternalSecret has synced. It refreshes every hour.
kubectl --context offsite -n mate get externalsecret mate-sandbox-talosResult:
STATUSisSecretSynced.Restart mate, which reads the file when it starts.
kubectl --context offsite -n mate rollout restart deploy/mateResult:
deployment.apps/mate restarted.
If something goes wrong#
| Symptom | Cause | Action |
|---|---|---|
mate logs the sandbox talosconfig could not be read, with grants os:admin. | The Document holds a certificate with a role other than os:reader. | Issue the Rowbutt talosconfig again. Then rotate the OS CA with talosctl rotate-ca --kubernetes=false, because the stored certificate cannot be revoked. A rotation of the Kubernetes CA too strands the workers fleetd installed, as PKI says. |
mate logs no sandbox talosconfig yet. | The Secret mate-sandbox-talos is absent. | Make sure that the item exists and the ExternalSecret has synced. |
config contexts shows <site>-1. | The merge renamed a context that was already in the file. | Start again in a new directory. |
Related#
- Get cluster admin access
- PKI: the talosconfig certificates.
- How Rowbutt works: the sandbox talosconfig.
Linked from 7
- optiplexA Dell OptiPlex 3050 micro that is the folly cluster's only control-plane node, on Talos Linux.
- retrofitAn HP EliteDesk 800 G2 mini PC that is the offsite cluster's only control-plane node, on Talos Linux.
- PKIThe FML certificate chain, the Kubernetes cluster CAs and token signers, the cluster OIDC issuers, workload identity federation and the hardware DevID CAs.
- Get cluster admin accessGet kubectl access to folly and offsite with the admin certificate from talosctl, and withdraw access.
- RunbooksStep-by-step procedures for the hosts, clusters, network, secrets and apps, grouped by area.
- Install Talos on a nodeBoot a running NixOS node into the Talos installer with kexec, check it in maintenance mode, and check its volumes after the install.
- Make a Talos secrets bundleGenerate a cluster's Talos secrets bundle with its imported service-account key, store it in 1Password, and pin its new Kubernetes CA in the cutover pull request.