hetzner

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransportTypeSATA = "sata"
	TransportTypeNVMe = "nvme"
)

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 GetSSHKeysResponse added in v0.20.0

type GetSSHKeysResponse []struct {
	Key struct {
		Name        string `json:"name"`
		Fingerprint string `json:"fingerprint"`
		Type        string `json:"type"`
		Size        int    `json:"size"`
		Data        string `json:"data"`
		CreatedAt   string `json:"created_at"`
	} `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) 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) 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,
)

func (*Hetzner) ValidateHetznerSSHKeyPair added in v0.20.0

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

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 LSBLKOutput added in v0.20.0

type LSBLKOutput struct {
	BlockDevices []LSBLKOutputRow `json:"blockdevices"`
}

type LSBLKOutputRow added in v0.20.0

type LSBLKOutputRow struct {
	Name string `json:"name"`
	WWN  string `json:"wwn"`
	Size int    `json:"size"`

	RotationalDevice   bool   `json:"rota"`
	TransportType      string `json:"tran"`
	PartitionTableType string `json:"pttype"`
}

REFER : https://github.com/util-linux/util-linux/blob/4a4eb88f263bfffeee75cfcabcb6e364ef5900a3/misc-utils/lsblk.c#L174.

func (*LSBLKOutputRow) GetDiskType added in v0.20.0

func (r *LSBLKOutputRow) GetDiskType() string

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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