Reference · pk-metal
Global flags
Two flags select the cluster that a command talks to.
They follow the rules of kubectl.
| Flag | Default | Description |
|---|---|---|
--kubeconfig<file> | - | The kubeconfig file. Without the flag, the program uses $KUBECONFIG, then ~/.kube/config, then the account of the pod that it runs in. |
--context<name> | - | The context in the kubeconfig. Without the flag, the program uses the current context. |
Where to put them
Section titled “Where to put them”Put the global flags before the command or after it. The two forms are equal.
The flags of a command can also come after its arguments. After --, each word is an argument.
pk-metal --context kind-pk-metal status
pk-metal status --context kind-pk-metal
pk-metal --kubeconfig .lab/kubeconfig top
Commands that accept them
Section titled “Commands that accept them”All commands that talk to the Kubernetes API accept the global flags:
- pk-metal status and pk-metal top
- pk-metal approve, pk-metal retry, pk-metal abort, pk-metal hold, pk-metal unhold and pk-metal rollout
- pk-metal reboot, pk-metal upgrade, pk-metal scale, pk-metal reinstall, pk-metal replace and pk-metal wipe
- pk-metal backup and pk-metal restore
- pk-metal pivot
These commands do not talk to the Kubernetes API, and they refuse the global flags after the command: pk-metal check, pk-metal inventory, pk-metal render, pk-metal boot, pk-metal bootstrap, pk-metal relay, pk-metal sim and pk-metal version.
Other inputs
Section titled “Other inputs”Some commands read a secret from the environment. A secret is never a flag, so it does not show in the process list.
| Variable | Used by | Content |
|---|---|---|
KUBECONFIG |
All commands that talk to the cluster | The kubeconfig file, when --kubeconfig is not set. |
PK_METAL_BMC_PASSWORD |
pk-metal check, pk-metal inventory, pk-metal boot | The password of the BMC user. |
PK_METAL_RELAY_SECRET |
pk-metal relay, pk-metal boot | The shared secret of the relay. |