Documentation
¶
Overview ¶
Package hcloudvolume implements the "hcloud-volume" storage driver — Rune's Hetzner Cloud Block Storage driver. It mirrors the shape of dovolume: per-call auth sourced from StorageClass `parameters.apiToken`, region pinning (Hetzner calls it `location`), and offline-only expand.
The driver is registered under the name "hcloud-volume" (operator-facing, hyphenated) while the Go package itself is "hcloudvolume" (Go forbids hyphens). Operators consume it by writing a StorageClass that points at it:
storageClass:
name: hcloud-ssd-nbg1
driver: hcloud-volume
parameters:
location: nbg1
fsType: ext4
apiToken: "secret:hcloud-api-token.shared.rune/token"
reclaimPolicy: retain
allowedTopologies:
- matchLabels:
rune.io/region: nbg1
Auth uses a Hetzner Cloud API Token sourced from the StorageClass `parameters.apiToken` value. The controller resolves any `secret:...` reference into plaintext before the driver sees it.
Hetzner Cloud volumes do NOT support snapshots — the driver advertises Capabilities.Snapshots = false and Snapshot / RestoreFromSnapshot / DeleteSnapshot all return driver.ErrUnsupported. Expand is supported but offline-only: the volume must be detached for the resize action to succeed.
Index ¶
Constants ¶
const DriverName = "hcloud-volume"
DriverName is the registry key.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// APIBaseURL overrides the Hetzner Cloud API endpoint. Defaults to
// "https://api.hetzner.cloud" — only set in tests against a
// httptest.Server.
APIBaseURL string
// VolumeNamePrefix is prepended to every Hetzner volume name created
// by this driver, so multiple Rune clusters can share one Hetzner
// project without colliding. Default "rune-".
VolumeNamePrefix string
}
Config is the runefile [storage.drivers.hcloud-volume] section after parsing. Only knobs that don't belong on per-StorageClass parameters live here — auth is sourced from StorageClass `parameters.apiToken`.