Skip to content

Command · pk-metal

pk-metal relay

changes no machineno cluster necessary

pk-metal relay runs on a host that can reach the BMCs, when your workstation cannot. The BMCs download boot media from the relay, and the relay passes that traffic to pk-metal boot.

pk-metal relay [--front addr] [--tunnel addr] [--advertise host:port] [--secret-file file] [--allow rules]

The command takes no arguments. It runs until you stop it.

FlagDefaultDescription
--advertise<string>-Front address as BMCs reach it (default: the bound address).
--allow<string>*:443Targets boot may dial through the relay, as <CIDR, IP or *>:<port or *>, comma-separated.
--front<string>127.0.0.1:8443BMC-facing listen address (media fetches arrive here).
--secret-file<string>-File with the shared secret; written with a new one when missing (or set $PK_METAL_RELAY_SECRET).
--tunnel<string>127.0.0.1:9443Operator-facing listen address (keep on loopback, reach over ssh -L).
Front address
The BMCs connect here to download the image. Put it on the BMC network.
Tunnel address
pk-metal boot connects here. It receives the downloads of the BMCs, and its Redfish calls go out to the BMCs through the relay.
Secret
Each connection to the tunnel must prove that it has the shared secret of the relay.

The relay does not decrypt the traffic. TLS ends in pk-metal boot.

The relay dials onward only to the targets in --allow. The default *:443 lets the relay dial each host on port 443, the port of Redfish. Give a shorter list to limit the relay to your BMC network, for example --allow 192.0.2.0/24:443.

  1. Set PK_METAL_RELAY_SECRET, or give a file with --secret-file. Do not give the two.
  2. If the file does not exist, the relay writes a new secret there. Only you can read the file.
  3. The relay does not replace a file that exists.
  4. Give the same secret to pk-metal boot.

The relay is for the first machines of a site. The operator does not use it.

On the host that can reach the BMCs:

relay host
pk-metal relay --front 10.0.0.2:8443 --secret-file ~/.config/pk-metal/relay.secret
relay: wrote a new secret to /home/admin/.config/pk-metal/relay.secret; give the same secret to pk-metal boot
relay: front 10.0.0.2:8443 (advertised 10.0.0.2:8443), tunnel 127.0.0.1:9443

On your workstation, open the tunnel and boot a machine through it:

Terminal window
ssh -N -L 9443:127.0.0.1:9443 admin@relay-host &
pk-metal boot --config clusterconfig/cp-1.yaml --node cp-1 \
--relay 127.0.0.1:9443 --relay-secret-file relay.secret https://192.0.2.11

The command reads and writes no object in the cluster. It does not talk to a BMC by itself.

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

The command gives code 1 if it has no secret, or if it cannot listen on one of the two addresses.