Skip to content

Command · pk-metal

pk-metal backup

changes machinesneeds the cluster

pk-metal backup works with the etcd snapshots of a Talos cluster. The operator takes the snapshots on the schedule of an EtcdBackupPolicy and keeps them encrypted.

The operator has no private key. It can store a snapshot, but it cannot read one. To decrypt, you need an age identity that agrees with a public key in the policy, on your workstation.

pk-metal backup now <cluster>pk-metal backup list [<cluster>]pk-metal backup get <snapshot> -o <file>pk-metal backup decrypt ...
Subcommand Effect Changes the cluster
now Takes a snapshot now and waits until the operator has it in the sink. Yes: one EtcdSnapshot
list Lists the snapshots, the newest first. No
get Downloads one encrypted snapshot. No
decrypt Decrypts a snapshot on your workstation and makes sure that it is intact. No

You can put the flags before or after the arguments.

pk-metal backup now <cluster>

FlagDefaultDescription
--timeout<duration>35m0sHow long --wait waits.
--waittrueWait until the snapshot is stored and verified.

This subcommand also accepts the global flags --kubeconfig and --context.

  1. The command finds the policy: the EtcdBackupPolicy with that name, or the one policy of the TalosCluster with that name.
  2. It makes an EtcdSnapshot with the name <policy>-manual-<time>.
  3. It waits until the operator stored and verified the snapshot, and prints each progress message.

If the cluster has more than one policy, give the name of a policy.

pk-metal backup list [<cluster>]

This subcommand has no flags of its own.

This subcommand also accepts the global flags --kubeconfig and --context.

The STATE column is Taking, Failed, Unverified or Verified.

pk-metal backup get <snapshot> -o <file>

FlagDefaultDescription
-o<string>required-File to write the encrypted snapshot to (it must not exist).

This subcommand also accepts the global flags --kubeconfig and --context.

The command downloads from an S3 sink. It reads the credentials of the sink from a Secret in the namespace pk-metal. It cannot read a snapshot on the backup volume of the operator (a pvc sink). Copy the file from the volume first.

pk-metal backup decrypt (<snapshot> | --in <file.age>) --identity <file> [-o <file.db>]

FlagDefaultDescription
--identity<string>required-Age identity file: the secret key, as age-keygen writes it.
--in<string>-Decrypt this file instead of downloading the snapshot.
-o<string>-Also write the plaintext snapshot here (mode 0600; it must not exist).

This subcommand also accepts the global flags --kubeconfig and --context.

  1. The command reads the age identity file.
  2. It decrypts the snapshot, from the sink or from the file of --in.
  3. It makes sure that the result is an intact etcd snapshot.
  4. For a snapshot from the sink, it compares the SHA-256 with the record in the EtcdSnapshot.
  5. With -o, it also writes the plaintext.

With --in, the command does not talk to the cluster.

pk-metal backup
pk-metal backup now lab
requested snapshot lab-daily-manual-20261124-093000 of cluster lab (policy lab-daily)
stored and verified: s3://backups/lab/lab-daily-manual-20261124-093000.db.age, 18.4MiB, from cp-1, sha256:3d1f0a9c5b7e42d86a1c0f9e8b7d6c5a4f3e2d1c0b9a8f7e6d5c4b3a29180716
pk-metal backup list lab
NAME                              CLUSTER  TAKEN    FROM  SIZE     STATE     LOCATION
lab-daily-manual-20261124-093000  lab      12s ago  cp-1  18.4MiB  Verified  s3://backups/lab/lab-daily-manual-20261124-093000.db.age
lab-daily-20261124-060000         lab      3h ago   cp-2  18.3MiB  Verified  s3://backups/lab/lab-daily-20261124-060000.db.age
pk-metal backup decrypt lab-daily-20261124-060000 --identity ~/.config/age/keys.txt
intact etcd snapshot: 18.3MiB, sha256:8a7b6c5d4e3f20112233445566778899aabbccddeeff00112233445566778899, bbolt transaction 48213

Download a snapshot and decrypt the file later.

Terminal window
pk-metal backup get lab-daily-20261124-060000 -o lab.db.age
pk-metal backup decrypt --in lab.db.age --identity ~/.config/age/keys.txt
Object Access Purpose
EtcdBackupPolicy get, list Finds the policy and the sink.
EtcdSnapshot create now: the request for a snapshot.
EtcdSnapshot get, list list, get, decrypt, and the wait of now.
Secret in pk-metal get get and decrypt: the credentials and the CA of the S3 sink.
CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".

now gives code 1 if the snapshot fails, if the operator stored it but did not verify it, or if the time of --timeout ends.