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.
Synopsis
Section titled “Synopsis”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.
| Flag | Default | Description |
|---|---|---|
--advertise<string> | - | Front address as BMCs reach it (default: the bound address). |
--allow<string> | *:443 | Targets boot may dial through the relay, as <CIDR, IP or *>:<port or *>, comma-separated. |
--front<string> | 127.0.0.1:8443 | BMC-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:9443 | Operator-facing listen address (keep on loopback, reach over ssh -L). |
What it does
Section titled “What it does”- Front address
- The BMCs connect here to download the image. Put it on the BMC network.
- Tunnel address
pk-metal bootconnects 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.
The secret
Section titled “The secret”- Set
PK_METAL_RELAY_SECRET, or give a file with--secret-file. Do not give the two. - If the file does not exist, the relay writes a new secret there. Only you can read the file.
- The relay does not replace a file that exists.
- Give the same secret to
pk-metal boot.
The relay is for the first machines of a site. The operator does not use it.
Examples
Section titled “Examples”On the host that can reach the BMCs:
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:
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.11Objects
Section titled “Objects”The command reads and writes no object in the cluster. It does not talk to a BMC by itself.
Exit status
Section titled “Exit status”The command gives code 1 if it has no secret, or if it cannot listen on one of the two addresses.
Related
Section titled “Related”- Relay explains the protocol and the secret.
- pk-metal boot is the program on the other end of the tunnel.
- Bootstrap without the operator