clusterapi

package
v1.4.17 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnitionSecret

func IgnitionSecret(ign []byte, infraID, role string) *corev1.Secret

IgnitionSecret provides the basic formatting for creating the ignition secret.

func InitializeProvider

func InitializeProvider(platform Provider) infrastructure.Provider

InitializeProvider returns a ClusterAPI provider implementation for a specific cloud platform.

Types

type BootstrapDestroyInput

type BootstrapDestroyInput struct {
	Client   client.Client
	Metadata types.ClusterMetadata
}

BootstrapDestroyInput collects args passed to the DestroyBootstrap hook.

type BootstrapDestroyer

type BootstrapDestroyer interface {
	DestroyBootstrap(ctx context.Context, in BootstrapDestroyInput) error
}

BootstrapDestroyer allows platform-specific behavior when destroying bootstrap resources.

type GatherEndpoint added in v0.90.17

type GatherEndpoint string

GatherEndpoint represents the valid values for connecting to the bootstrap nude in a public cluster to gather logs.

const (
	// ExternalIP indicates that the machine status will include an ExternalIP that can be used for gather.
	ExternalIP GatherEndpoint = "ExternalIP"

	// InternalIP indicates that the machine status will only include InternalIPs.
	InternalIP GatherEndpoint = "InternalIP"

	// APILoadBalancer indicates that gather bootstrap should connect to the API load balancer.
	APILoadBalancer GatherEndpoint = "APILoadBalancer"
)

type IgnitionInput

type IgnitionInput struct {
	Client           client.Client
	BootstrapIgnData []byte
	InfraID          string
	InstallConfig    *installconfig.InstallConfig
	TFVarsAsset      *tfvars.TerraformVariables
}

IgnitionInput collects the args passed to the IgnitionProvider call.

type IgnitionProvider

type IgnitionProvider interface {
	Ignition(ctx context.Context, in IgnitionInput) ([]byte, error)
}

IgnitionProvider handles preconditions for bootstrap ignition and generates ignition data for the CAPI bootstrap ignition secret.

WARNING! Low-level primitive. Use only if absolutely necessary.

type InfraProvider

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

InfraProvider implements common Cluster API logic and contains the platform CAPI provider, which is called in the lifecycle defined by the Provider interface.

func (*InfraProvider) DestroyBootstrap

func (i *InfraProvider) DestroyBootstrap(ctx context.Context, dir string) error

DestroyBootstrap destroys the temporary bootstrap resources.

func (*InfraProvider) ExtractHostAddresses

func (i *InfraProvider) ExtractHostAddresses(dir string, config *types.InstallConfig, ha *infrastructure.HostAddresses) error

ExtractHostAddresses extracts the IPs of the bootstrap and control plane machines.

func (*InfraProvider) Provision

func (i *InfraProvider) Provision(ctx context.Context, dir string, parents asset.Parents) (fileList []*asset.File, err error)

Provision creates cluster resources by applying CAPI manifests to a locally running control plane.

type InfraReadyInput

type InfraReadyInput struct {
	// Client is the client for kube-apiserver running locally on the installer host.
	// It can be used to read the status of the cluster object on the local control plane.
	Client        client.Client
	InstallConfig *installconfig.InstallConfig
	InfraID       string
}

InfraReadyInput collects the args passed to the InfraReady call.

type InfraReadyProvider

type InfraReadyProvider interface {
	// InfraReady is called once cluster.Status.InfrastructureReady
	// is true, typically after load balancers have been provisioned. It can be used
	// to create DNS records.
	InfraReady(ctx context.Context, in InfraReadyInput) error
}

InfraReadyProvider defines the InfraReady hook, which is called after the initial infrastructure manifests have been created and InfrastructureReady == true on the cluster status, and before IgnitionProvider hook and creation of the control-plane machines.

type PostDestroyer

type PostDestroyer interface {
	PostDestroy(ctx context.Context, in PostDestroyerInput) error
}

PostDestroyer allows platform-specific behavior after bootstrap has been destroyed and ClusterAPI has stopped running.

type PostDestroyerInput

type PostDestroyerInput struct {
	Metadata types.ClusterMetadata
}

PostDestroyerInput collects args passed to the PostDestroyer hook.

type PostProvider

type PostProvider interface {
	PostProvision(ctx context.Context, in PostProvisionInput) error
}

PostProvider defines the PostProvision hook, which is called after machine provisioning has completed.

type PostProvisionInput

type PostProvisionInput struct {
	Client        client.Client
	InstallConfig *installconfig.InstallConfig
	InfraID       string
}

PostProvisionInput collects the args passed to the PostProvision hook.

type PreProvider

type PreProvider interface {
	// PreProvision is called before provisioning using CAPI controllers has begun
	// and should be used to create dependencies needed for CAPI provisioning,
	// such as IAM roles or policies.
	PreProvision(ctx context.Context, in PreProvisionInput) error
}

PreProvider defines the PreProvision hook, which is called prior to CAPI infrastructure provisioning.

type PreProvisionInput

type PreProvisionInput struct {
	InfraID          string
	InstallConfig    *installconfig.InstallConfig
	RhcosImage       *rhcos.Image
	ManifestsAsset   *manifests.Manifests
	MachineManifests []client.Object
	WorkersAsset     *machines.Worker
}

PreProvisionInput collects the args passed to the PreProvision call.

type Provider

type Provider interface {
	// Name provides the name for the cloud platform.
	Name() string

	// PublicGatherEndpoint returns how the cloud platform expects the installer
	// to connect to the bootstrap node for log gathering. CAPI providers are not
	// consistent in how public IP addresses are represented in the machine status.
	// Furthermore, Azure cannot attach a public IP to the bootstrap node, so SSH
	// must be performed through the API load balancer.
	// When a platform returns ExternalIP, the installer will require an ExternalIP
	// to be present in the status, before it declares the machine ready.
	PublicGatherEndpoint() GatherEndpoint
}

Provider is the base interface that cloud platforms should implement for the CAPI infrastructure provider.

type Timeouts

type Timeouts interface {
	// When waiting for the network infrastructure to become ready.
	NetworkTimeout() time.Duration
	// When waiting for the machines to provision.
	ProvisionTimeout() time.Duration
}

Timeouts allows platform provider to override the timeouts for certain phases.

Jump to

Keyboard shortcuts

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