hetzner

package
v0.0.0-...-626ffdb Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name         = "hetzner"
	DefaultImage = "ubuntu-24.04"
	DefaultArch  = string(hcloud.ArchitectureX86)
)

Variables

View Source
var (
	ErrBadSSHKey               = errors.New("bad ssh key")
	ErrBadLoadBalancerConfig   = errors.New("load balancer config must have location or networkZone set")
	ErrSSHKeyNotPresent        = errors.New("ssh key not present")
	ErrUnknownImage            = errors.New("unknown server image")
	ErrUnknownLocation         = errors.New("unknown server location")
	ErrUnknownLoadBalancer     = errors.New("unknown load balancer")
	ErrUnknownLoadBalancerType = errors.New("unknown load balancer type")
	ErrUnknownServerType       = errors.New("unknown server type")
)
View Source
var ErrMultipleCandidates = func(resource string) error {
	return fmt.Errorf("multiple %s resources exist", resource)
}

Functions

This section is empty.

Types

type Config

type Config struct {
	Token string `validate:"required"`
	SSHKey
	LoadBalancer
}

func (*Config) Validate

func (c *Config) Validate() error

type Hetzner

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

func (*Hetzner) ApplyCSI

func (*Hetzner) CreateServer

func (h *Hetzner) CreateServer(ctx context.Context, name string, nodeConfig config.ClusterNodePool, labels labelSelector, sshKey *hcloud.SSHKey, placementGroup *hcloud.PlacementGroup, nodeType common.NodeType, network *hcloud.Network) (*hcloud.Server, error)

func (*Hetzner) DatastoreCreate

func (h *Hetzner) DatastoreCreate(context.Context) (*provider.DatastoreCreateResponse, error)

func (*Hetzner) DatastoreDelete

func (h *Hetzner) DatastoreDelete(context.Context) (*provider.DatastoreDeleteResponse, error)

func (*Hetzner) DeleteAllResources

func (h *Hetzner) DeleteAllResources(ctx context.Context) error

func (*Hetzner) GetProviderSecrets

func (h *Hetzner) GetProviderSecrets(ctx context.Context) (map[string]string, error)

func (*Hetzner) ManagerAddress

func (h *Hetzner) ManagerAddress(ctx context.Context) (*provider.ManagerAddressResponse, error)

func (*Hetzner) NodeCreate

func (*Hetzner) NodeDelete

func (*Hetzner) NodeList

func (*Hetzner) Prepare

func (h *Hetzner) Prepare(ctx context.Context) (*provider.PrepareResponse, error)

func (*Hetzner) SetClusterNodePoolDefaults

func (h *Hetzner) SetClusterNodePoolDefaults(c config.ClusterNodePool) config.ClusterNodePool

type LabelKey

type LabelKey string
const (
	LabelKeyCluster LabelKey = "cluster"
	LabelKeyType    LabelKey = "type"
	LabelKeyPool    LabelKey = "pool"
	LabelKeyCount   LabelKey = "count"
)

type LoadBalancer

type LoadBalancer struct {
	Location    string
	NetworkZone hcloud.NetworkZone
	Type        string
}

type SSHKey

type SSHKey struct {
	Public string `validate:"required,file"`

	Private string `validate:"required,file"`

	Passphase string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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