Documentation
¶
Overview ¶
Package hcloudccminstaller provides installation of the Hetzner Cloud Controller Manager.
The cloud controller manager enables LoadBalancer services on Hetzner Cloud clusters by automatically provisioning and managing Hetzner Load Balancers.
Prerequisites:
- HCLOUD_TOKEN environment variable must be set with a valid Hetzner Cloud API token
- The token requires read/write permissions for Load Balancers
The installer creates a Kubernetes secret with the API token and deploys the cloud controller manager via its Helm chart. The secret is shared with the Hetzner CSI driver if both components are installed.
Index ¶
Constants ¶
const DefaultClusterCIDR = "10.244.0.0/16"
DefaultClusterCIDR is the default pod CIDR for Kubernetes clusters. This matches the Talos/Kubernetes default and is required by Cilium in ipam.mode=kubernetes for node pod CIDR allocation.
Variables ¶
var ErrHetznerTokenNotSet = hetzner.ErrTokenNotSet
ErrHetznerTokenNotSet is returned when the HCLOUD_TOKEN environment variable is not set.
Functions ¶
func ExtractClusterNameFromTalosContext ¶ added in v7.6.1
ExtractClusterNameFromTalosContext extracts the cluster name from a Talos kubeconfig context string. Talos contexts follow the pattern "admin@<name>".
func ResolveHetznerNetworkName ¶ added in v7.4.2
ResolveHetznerNetworkName determines the Hetzner Cloud private network name for the CCM from the cluster configuration.
Resolution order:
- If spec.provider.hetzner.networkName is explicitly set, use that. This matches the API contract: "If empty, a network named '<cluster-name>-network' will be created."
- Extract the cluster name from the kubeconfig context (e.g., "admin@dev" → "dev") and append the standard network suffix ("-network") to match what hetzner.Provider.EnsureNetwork creates.
- Use the provided clusterName fallback (from the CLI / provisioner) and append the network suffix. This ensures the installer always matches the network that hetzner.Provider.EnsureNetwork creates, even when Connection.Context is empty or doesn't follow the "admin@<name>" pattern.
Returns empty string if the network name cannot be determined.
Types ¶
type Installer ¶
Installer installs or upgrades the Hetzner Cloud Controller Manager.
It delegates to hetzner.Installer which handles the shared Hetzner lifecycle: creating the HCLOUD_TOKEN secret and installing the Helm chart.
The cloud controller manager enables LoadBalancer services on Hetzner Cloud by provisioning Hetzner Load Balancers and managing their lifecycle. It also initializes nodes by matching Kubernetes nodes to Hetzner Cloud servers using private network IPs (requires HCLOUD_NETWORK to be set).
Prerequisites:
- HCLOUD_TOKEN environment variable must be set with a valid Hetzner Cloud API token
- The token requires read/write access to Load Balancers
func NewInstaller ¶
func NewInstaller( client helm.Interface, kubeconfig, context string, timeout time.Duration, networkName string, ) *Installer
NewInstaller creates a new Hetzner Cloud Controller Manager installer instance. The networkName parameter specifies the Hetzner Cloud private network name that CCM uses to look up servers by their private IPs. If empty, networking support is not enabled in the CCM chart values.
When networkName is set, the network name is stored in the shared "hcloud" Kubernetes secret (key "network") so the chart's default valueFrom.secretKeyRef can read it as HCLOUD_NETWORK.