Documentation
¶
Index ¶
- func IgnitionSecret(ign []byte, infraID, role string) *corev1.Secret
- func InitializeProvider(platform Provider) infrastructure.Provider
- type BootstrapDestroyInput
- type BootstrapDestroyer
- type GatherEndpoint
- type IgnitionEditFunc
- type IgnitionInput
- type IgnitionOutput
- func ApplyIgnitionEdits(ctx context.Context, in IgnitionInput, edits ...IgnitionEditFunc) (*IgnitionOutput, error)
- func EditIgnitionForCustomDNS(in IgnitionInput, platform string, ...) (*IgnitionOutput, error)
- func EditIgnitionForDualStack(in IgnitionInput, platform string, machineNetworks []types.MachineNetworkEntry) (*IgnitionOutput, error)
- type IgnitionProvider
- type InfraProvider
- func (i *InfraProvider) DestroyBootstrap(ctx context.Context, dir string) error
- func (i *InfraProvider) ExtractHostAddresses(dir string, config *types.InstallConfig, ha *infrastructure.HostAddresses) error
- func (i *InfraProvider) Provision(ctx context.Context, dir string, parents asset.Parents) (fileList []*asset.File, err error)
- type InfraReadyInput
- type InfraReadyProvider
- type PostDestroyer
- type PostDestroyerInput
- type PostProvider
- type PostProvisionInput
- type PreProvider
- type PreProvisionInput
- type Provider
- type Timeouts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IgnitionSecret ¶
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 IgnitionEditFunc ¶
type IgnitionEditFunc func(context.Context, IgnitionInput) (*IgnitionOutput, error)
IgnitionEditFunc is a function that edits ignition data.
type IgnitionInput ¶
type IgnitionInput struct {
Client client.Client
BootstrapIgnData []byte
MasterIgnData []byte
WorkerIgnData []byte
InfraID string
InstallConfig *installconfig.InstallConfig
TFVarsAsset *tfvars.TerraformVariables
RootCA *tls.RootCA
}
IgnitionInput collects the args passed to the IgnitionProvider call.
func (IgnitionInput) WithOutput ¶
func (in IgnitionInput) WithOutput(output *IgnitionOutput) IgnitionInput
WithOutput returns a new IgnitionInput with ignition data from the output. This allows chaining multiple ignition edits.
type IgnitionOutput ¶
type IgnitionOutput struct {
UpdatedBootstrapIgn []byte
UpdatedMasterIgn []byte
UpdatedWorkerIgn []byte
}
IgnitionOutput collects updated Ignition Data for Bootstrap, Master and Worker nodes.
func ApplyIgnitionEdits ¶
func ApplyIgnitionEdits(ctx context.Context, in IgnitionInput, edits ...IgnitionEditFunc) (*IgnitionOutput, error)
ApplyIgnitionEdits applies multiple ignition edit functions in sequence, passing the ignition output of each as input to the next. Returns the final output or the first error encountered.
func EditIgnitionForCustomDNS ¶
func EditIgnitionForCustomDNS(in IgnitionInput, platform string, publicIPAddresses, privateIPAddresses []string) (*IgnitionOutput, error)
EditIgnitionForCustomDNS attempts to edit the contents of the bootstrap ignition when the user has selected a custom DNS configuration. Find the public and private load balancer addresses and fill in the infrastructure file within the ignition struct.
func EditIgnitionForDualStack ¶
func EditIgnitionForDualStack(in IgnitionInput, platform string, machineNetworks []types.MachineNetworkEntry) (*IgnitionOutput, error)
EditIgnitionForDualStack attempts to edit the contents of the bootstrap ignition when the cluster is in dualstack.
type IgnitionProvider ¶
type IgnitionProvider interface {
Ignition(ctx context.Context, in IgnitionInput) ([]*corev1.Secret, error)
}
IgnitionProvider handles preconditions for bootstrap ignition, such as pushing to cloud storage. Returns bootstrap and master ignition secrets.
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.
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.