|
| 1 | +# caphcli |
| 2 | + |
| 3 | +`caphcli` is a standalone CLI for CAPH bare-metal provisioning checks. |
| 4 | + |
| 5 | +It currently exposes the `check-bm-servers` command that was extracted from CAPH PR `#1873` and moved into this repository. |
| 6 | + |
| 7 | +## Build |
| 8 | + |
| 9 | +```bash |
| 10 | +go build . |
| 11 | +``` |
| 12 | + |
| 13 | +## Required Environment Variables |
| 14 | + |
| 15 | +- `HETZNER_ROBOT_USER` and `HETZNER_ROBOT_PASSWORD` for Hetzner Robot API access. |
| 16 | +- `SSH_KEY_NAME` for the Robot SSH key name to use or create. |
| 17 | +- One of `HETZNER_SSH_PUB_PATH` or `HETZNER_SSH_PUB` for the SSH public key. |
| 18 | +- One of `HETZNER_SSH_PRIV_PATH` or `HETZNER_SSH_PRIV` for the SSH private key. |
| 19 | + |
| 20 | +## Keeping This README Up To Date |
| 21 | + |
| 22 | +The official Cobra helper for generated command docs is `github.com/spf13/cobra/doc`. |
| 23 | +This repo keeps the help blocks below in sync with the actual command tree via: |
| 24 | + |
| 25 | +```bash |
| 26 | +go generate ./... |
| 27 | +``` |
| 28 | + |
| 29 | +That runs `go run ./internal/tools/readmegen`, which rebuilds this README from the live Cobra commands. |
| 30 | + |
| 31 | +## CLI Help |
| 32 | + |
| 33 | +### `caphcli --help` |
| 34 | + |
| 35 | +```text |
| 36 | +CAPH developer and operations CLI |
| 37 | +
|
| 38 | +Usage: |
| 39 | + caphcli [command] |
| 40 | +
|
| 41 | +Available Commands: |
| 42 | + check-bm-servers Validate rescue and provisioning reliability for one bare-metal server |
| 43 | + completion Generate the autocompletion script for the specified shell |
| 44 | + help Help about any command |
| 45 | +
|
| 46 | +Flags: |
| 47 | + -h, --help help for caphcli |
| 48 | +
|
| 49 | +Use "caphcli [command] --help" for more information about a command. |
| 50 | +``` |
| 51 | + |
| 52 | +### `caphcli check-bm-servers --help` |
| 53 | + |
| 54 | +```text |
| 55 | +Validate rescue and provisioning reliability for one HetznerBareMetalHost from a local YAML file. |
| 56 | +
|
| 57 | +The command does not talk to Kubernetes. It reads one local YAML file containing |
| 58 | +HetznerBareMetalHost objects and then talks directly to Hetzner Robot plus the |
| 59 | +target server. |
| 60 | +
|
| 61 | +Usage: |
| 62 | + caphcli check-bm-servers [flags] |
| 63 | +
|
| 64 | +Examples: |
| 65 | + caphcli check-bm-servers \ |
| 66 | + --file test/e2e/data/infrastructure-hetzner/v1beta1/bases/hetznerbaremetalhosts.yaml \ |
| 67 | + --name bm-e2e-1731561 |
| 68 | +
|
| 69 | +Flags: |
| 70 | + --file string Path to a local YAML file containing HetznerBareMetalHost objects (required) |
| 71 | + --force Skip the destructive-action confirmation prompt |
| 72 | + -h, --help help for check-bm-servers |
| 73 | + --image-path string Installimage IMAGE path for operating system inside the Hetzner rescue system (default "/root/.oldroot/nfs/images/Ubuntu-2404-noble-amd64-base.tar.gz") |
| 74 | + --name string HetznerBareMetalHost metadata.name. Optional if YAML contains exactly one host |
| 75 | + --poll-interval duration Polling interval for wait steps (default 10s) |
| 76 | + --timeout-activate-rescue duration Timeout for activating rescue boot (default 45s) |
| 77 | + --timeout-check-disk-rescue duration Timeout for checking target disks in rescue (default 1m0s) |
| 78 | + --timeout-ensure-ssh-key duration Timeout for ensuring SSH key in Robot (default 1m0s) |
| 79 | + --timeout-fetch-server duration Timeout for fetching server details from Robot (default 30s) |
| 80 | + --timeout-install duration Timeout for one Ubuntu install step (default 9m0s) |
| 81 | + --timeout-load-input duration Timeout for input parsing + env loading (default 30s) |
| 82 | + --timeout-reboot-os duration Timeout for rebooting into installed OS (default 45s) |
| 83 | + --timeout-reboot-rescue duration Timeout for requesting reboot to rescue (default 45s) |
| 84 | + --timeout-wait-os duration Timeout for waiting until installed OS is reachable (default 6m0s) |
| 85 | + --timeout-wait-rescue duration Timeout for waiting until rescue SSH is reachable (default 6m0s) |
| 86 | +``` |
0 commit comments