hetzner

package
v0.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHetznerCloudProvider

func NewHetznerCloudProvider() cloud.CloudProvider

Types

type CreateVSwitchResponseBody added in v0.16.0

type CreateVSwitchResponseBody struct {
	ID int `json:"id"`

	Name   string `json:"name"`
	VLANID int    `json:"vlan"`

	Cancelled bool `json:"cancelled"`
}

type FailoverIPDetails added in v0.12.0

type FailoverIPDetails struct {
	ActiveServerIP string `json:"active_server_ip"`
}

type GetFailoverIPDetailsResponse added in v0.12.0

type GetFailoverIPDetailsResponse struct {
	Failover FailoverIPDetails `json:"failover"`
}

type GetKeysResponse added in v0.21.0

type GetKeysResponse []struct {
	Key Key `json:"key"`
}

type GetServerResponseBody added in v0.20.0

type GetServerResponseBody struct {
	Server Server `json:"server"`
}

type HCloudMachineTemplateUpdates added in v0.18.0

type HCloudMachineTemplateUpdates struct {
	NewImageName string
}

type Hetzner

type Hetzner struct {
	// contains filtered or unexported fields
}

func (*Hetzner) AttachHCloudServerToNetwork added in v0.20.0

func (h *Hetzner) AttachHCloudServerToNetwork(ctx context.Context, serverID, networkID int)

Attaches the given HCloud server to the given Hetzner Network.

func (*Hetzner) AttachServerToVSwitch added in v0.20.0

func (h *Hetzner) AttachServerToVSwitch(ctx context.Context, serverID string, vswitchID int)

func (*Hetzner) ConnectVSwitchWithHetznerNetwork added in v0.20.0

func (h *Hetzner) ConnectVSwitchWithHetznerNetwork(ctx context.Context, network *hcloud.Network)

When using Hetzner Bare Metal, we need to establish private connectivity between them and the HCloud servers in a Hetzner Network, using a VSwitch.

func (*Hetzner) CreateHCloudSSHKey added in v0.21.0

func (h *Hetzner) CreateHCloudSSHKey(ctx context.Context, name string, sshKeyPair config.SSHKeyPairConfig)

Creates the given SSH key in HCloud, if it doesn't already exist.

func (*Hetzner) CreateHetznerBareMetalSSHKey added in v0.21.0

func (h *Hetzner) CreateHetznerBareMetalSSHKey(
	ctx context.Context,
	name string,
	sshKeyPair config.SSHKeyPairConfig,
)

Creates the given SSH key in Hetzner Bare Metal, if it doesn't already exist.

func (*Hetzner) CreateLB added in v0.21.0

func (h *Hetzner) CreateLB(ctx context.Context,
	clusterName string,
	network *hcloud.Network,
	location string,
) *hcloud.LoadBalancer

Creates the Hetzner LB, if it doesn't already exist. The Hetzner LB details are returned.

func (*Hetzner) CreateNATGateway added in v0.21.0

func (h *Hetzner) CreateNATGateway(ctx context.Context, networkID int)

func (*Hetzner) CreateNetwork added in v0.20.0

func (h *Hetzner) CreateNetwork(ctx context.Context) *hcloud.Network

Creates the Hetzner Network, if it doesn't already exist. The Hetzner Network details are returned.

func (*Hetzner) CreateVSwitch added in v0.16.0

func (h *Hetzner) CreateVSwitch(ctx context.Context) int

A VSwitch is used to establish private connectivity between Hetzner Bare Metal servers (and a Hetzner Network, when spinning up a Hetzner hybrid cluster). This function is responsible for creating that VSwitch, if it doesn't already exist. The VSwitch ID gets returned.

func (*Hetzner) GenerateStoragePlans added in v0.20.0

func (h *Hetzner) GenerateStoragePlans(ctx context.Context, hetznerConfig *config.HetznerConfig)

func (*Hetzner) GetHCloudServerIDsForCluster added in v0.20.0

func (h *Hetzner) GetHCloudServerIDsForCluster(ctx context.Context, name string) []int

Returns IDs of the HCloud servers associated with the given Kubernetes cluster which was provisioned using Cluster API Provider Hetzner (CAPH).

func (*Hetzner) GetLatestBackupName

func (*Hetzner) GetLatestBackupName(ctx context.Context) string

func (*Hetzner) GetVMSpecs

func (h *Hetzner) GetVMSpecs(ctx context.Context, machineType string) *cloud.VMSpec

func (*Hetzner) PointFailoverIPToInitMasterNode added in v0.12.0

func (h *Hetzner) PointFailoverIPToInitMasterNode(ctx context.Context)

func (*Hetzner) ProvisionPrerequisiteInfrastructure added in v0.21.0

func (h *Hetzner) ProvisionPrerequisiteInfrastructure(ctx context.Context)

Provisions infrastructure required before CAPH starts spinning up the cluster.

func (*Hetzner) SetupDisasterRecovery

func (*Hetzner) SetupDisasterRecovery(ctx context.Context)

func (*Hetzner) UpdateCapiClusterValuesFile added in v0.18.0

func (*Hetzner) UpdateCapiClusterValuesFile(ctx context.Context, path string, updates any)

func (*Hetzner) UpdateMachineTemplate

func (*Hetzner) UpdateMachineTemplate(ctx context.Context,
	clusterClient client.Client,
	name string,
	updates any,
)

type HetznerBareMetalMachineTemplateUpdates added in v0.18.0

type HetznerBareMetalMachineTemplateUpdates struct {
	NewImagePath string
}

type HetznerMachineTemplateUpdates added in v0.18.0

type HetznerMachineTemplateUpdates struct {
	HCloudMachineTemplateUpdates
	HetznerBareMetalMachineTemplateUpdates
}

type Key added in v0.21.0

type Key struct {
	Name        string `json:"name"`
	Fingerprint string `json:"fingerprint"`
}

type ListVSwitchResponseBody added in v0.16.0

type ListVSwitchResponseBody = []struct {
	ID int `json:"id"`

	Name   string `json:"name"`
	VLANID int    `json:"vlan"`

	Cancelled bool `json:"cancelled"`
}

type Server added in v0.20.0

type Server struct {
	IP string `json:"server_ip"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL