capi

package
v0.0.0-...-d91ab75 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MPL-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package capi manages CAPI installation, provides default client for CAPI CRDs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckClusterReady

func CheckClusterReady(ctx context.Context, metalClient client.Client, clusterName string) error

CheckClusterReady verifies that cluster ready from the CAPI point of view.

func GetMetalClient

func GetMetalClient(config *rest.Config) (runtimeclient.Client, error)

GetMetalClient builds k8s client with schemes required to access all the CAPI/Sidero/Talos components.

Types

type Cluster

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

Cluster attaches to the provisioned CAPI cluster and provides talos.Cluster.

func NewCluster

func NewCluster(ctx context.Context, metalClient runtimeclient.Reader, clusterName string, bridgeIP netip.Addr) (*Cluster, error)

NewCluster fetches cluster info from the CAPI state.

func (*Cluster) BridgeIP

func (cluster *Cluster) BridgeIP() netip.Addr

BridgeIP returns IP of the bridge which controls the cluster.

func (*Cluster) Health

func (cluster *Cluster) Health(ctx context.Context) error

Health runs the healthcheck for the cluster.

func (*Cluster) KubernetesClient

func (cluster *Cluster) KubernetesClient() taloscluster.K8sProvider

KubernetesClient provides K8s client source.

func (*Cluster) Name

func (cluster *Cluster) Name() string

Name of the cluster.

func (*Cluster) SideroComponentsIP

func (cluster *Cluster) SideroComponentsIP() net.IP

SideroComponentsIP returns the IP for the Sidero components (TFTP, iPXE, etc.).

type Manager

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

Manager installs and controls cluster API installation.

func NewManager

func NewManager(ctx context.Context, cluster talos.Cluster, options Options) (*Manager, error)

NewManager creates new Manager object.

func (*Manager) GetKubeconfig

func (clusterAPI *Manager) GetKubeconfig(ctx context.Context) (client.Kubeconfig, error)

GetKubeconfig returns kubeconfig in clusterctl expected format.

func (*Manager) GetManagerClient

func (clusterAPI *Manager) GetManagerClient() client.Client

GetManagerClient client returns instance of cluster API client.

func (*Manager) GetMetalClient

func (clusterAPI *Manager) GetMetalClient(ctx context.Context) (runtimeclient.Client, error)

GetMetalClient returns k8s client stuffed with CAPI CRDs.

func (*Manager) Install

func (clusterAPI *Manager) Install(ctx context.Context) error

Install the Manager components and wait for them to be ready.

type Options

type Options struct {
	ClusterctlConfigPath    string
	CoreProvider            string
	BootstrapProviders      []string
	InfrastructureProviders []string
	ControlPlaneProviders   []string

	PowerSimulatedExplicitFailureProb float64
	PowerSimulatedSilentFailureProb   float64
}

Options for the CAPI installer.

Jump to

Keyboard shortcuts

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