snow

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SnowClusterKind         = "AWSSnowCluster"
	SnowMachineTemplateKind = "AWSSnowMachineTemplate"
)

Variables

This section is empty.

Functions

func CAPICluster

func CAPICluster(clusterSpec *cluster.Spec, snowCluster *snowv1.AWSSnowCluster, kubeadmControlPlane *controlplanev1.KubeadmControlPlane) *clusterv1.Cluster

func CAPIObjects added in v0.9.0

func CAPIObjects(ctx context.Context, clusterSpec *cluster.Spec, kubeClient kubernetes.Client) (controlPlaneSpec, workersSpec []byte, err error)

func ControlPlaneObjects

func ControlPlaneObjects(ctx context.Context, clusterSpec *cluster.Spec, kubeClient kubernetes.Client) ([]runtime.Object, error)

func KubeadmConfigTemplate added in v0.11.0

func KubeadmConfigTemplate(clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) (*bootstrapv1.KubeadmConfigTemplate, error)

func KubeadmControlPlane

func KubeadmControlPlane(clusterSpec *cluster.Spec, snowMachineTemplate *snowv1.AWSSnowMachineTemplate) (*controlplanev1.KubeadmControlPlane, error)

func MachineDeployments

func MachineDeployments(clusterSpec *cluster.Spec, kubeadmConfigTemplates map[string]*bootstrapv1.KubeadmConfigTemplate, machineTemplates map[string]*snowv1.AWSSnowMachineTemplate) map[string]*clusterv1.MachineDeployment

func NewKubeadmConfigTemplateName added in v0.9.2

func NewKubeadmConfigTemplateName(new, old *bootstrapv1.KubeadmConfigTemplate) string

func NewMachineTemplateName added in v0.9.0

func NewMachineTemplateName(new, old *snowv1.AWSSnowMachineTemplate) string

func NewWorkerMachineTemplateName added in v0.9.2

func NewWorkerMachineTemplateName(newMt, oldMt *snowv1.AWSSnowMachineTemplate, newKct, oldKct *bootstrapv1.KubeadmConfigTemplate) string

func SnowCluster

func SnowCluster(clusterSpec *cluster.Spec) *snowv1.AWSSnowCluster

func SnowMachineTemplate

func SnowMachineTemplate(name string, machineConfig *v1alpha1.SnowMachineConfig) *snowv1.AWSSnowMachineTemplate

func WorkersMachineAndConfigTemplate added in v0.9.2

func WorkersMachineAndConfigTemplate(ctx context.Context, kubeClient kubernetes.Client, clusterSpec *cluster.Spec) (map[string]*snowv1.AWSSnowMachineTemplate, map[string]*bootstrapv1.KubeadmConfigTemplate, error)

func WorkersObjects

func WorkersObjects(ctx context.Context, clusterSpec *cluster.Spec, kubeClient kubernetes.Client) ([]runtime.Object, error)

Types

type AwsClient added in v0.9.0

type AwsClient interface {
	EC2ImageExists(ctx context.Context, imageID string) (bool, error)
	EC2KeyNameExists(ctx context.Context, keyName string) (bool, error)
	EC2ImportKeyPair(ctx context.Context, keyName string, keyMaterial []byte) error
}

type AwsClientMap added in v0.9.0

type AwsClientMap map[string]AwsClient

func NewAwsClientMap added in v0.9.0

func NewAwsClientMap(awsClients aws.Clients) AwsClientMap

type ConfigManager added in v0.9.0

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

func NewConfigManager added in v0.9.0

func NewConfigManager(defaulters *Defaulters, validators *Validator) *ConfigManager

func (*ConfigManager) SetDefaultsAndValidate added in v0.9.0

func (cm *ConfigManager) SetDefaultsAndValidate(ctx context.Context, config *cluster.Config) error

type Defaulters added in v0.9.0

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

func NewDefaulters added in v0.9.0

func NewDefaulters(aws aws.Clients, writer filewriter.FileWriter) *Defaulters

func NewDefaultersFromAwsClientMap added in v0.9.0

func NewDefaultersFromAwsClientMap(awsClientMap AwsClientMap, writer filewriter.FileWriter, keyGenerator SshKeyGenerator) *Defaulters

func (*Defaulters) GenerateDefaultSshKeys added in v0.9.0

func (d *Defaulters) GenerateDefaultSshKeys(ctx context.Context, machineConfigs map[string]*v1alpha1.SnowMachineConfig) error

type KubeUnAuthClient added in v0.9.0

type KubeUnAuthClient interface {
	KubeconfigClient(kubeconfig string) kubernetes.Client
	Delete(ctx context.Context, name, namespace, kubeconfig string, obj runtime.Object) error
}

type MachineConfigDefaulters added in v0.9.0

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

func NewMachineConfigDefaulters added in v0.9.0

func NewMachineConfigDefaulters(d *Defaulters) *MachineConfigDefaulters

func (*MachineConfigDefaulters) SetupDefaultSshKey added in v0.9.0

func (md *MachineConfigDefaulters) SetupDefaultSshKey(ctx context.Context, m *v1alpha1.SnowMachineConfig) error

type SnowProvider added in v0.9.0

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

func NewProvider

func NewProvider(kubeUnAuthClient KubeUnAuthClient, configManager *ConfigManager, skipIpCheck bool) *SnowProvider

func (*SnowProvider) BootstrapClusterOpts added in v0.9.0

func (p *SnowProvider) BootstrapClusterOpts(_ *cluster.Spec) ([]bootstrapper.BootstrapClusterOption, error)

func (*SnowProvider) ChangeDiff added in v0.9.0

func (p *SnowProvider) ChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ComponentChangeDiff

func (*SnowProvider) DatacenterConfig added in v0.9.0

func (p *SnowProvider) DatacenterConfig(clusterSpec *cluster.Spec) providers.DatacenterConfig

func (*SnowProvider) DatacenterResourceType added in v0.9.0

func (p *SnowProvider) DatacenterResourceType() string

func (*SnowProvider) DeleteResources added in v0.9.0

func (p *SnowProvider) DeleteResources(ctx context.Context, clusterSpec *cluster.Spec) error

func (*SnowProvider) EnvMap added in v0.9.0

func (p *SnowProvider) EnvMap(clusterSpec *cluster.Spec) (map[string]string, error)

func (*SnowProvider) GenerateCAPISpecForCreate added in v0.9.0

func (p *SnowProvider) GenerateCAPISpecForCreate(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) (controlPlaneSpec, workersSpec []byte, err error)

func (*SnowProvider) GenerateCAPISpecForUpgrade added in v0.9.0

func (p *SnowProvider) GenerateCAPISpecForUpgrade(ctx context.Context, bootstrapCluster, _ *types.Cluster, _ *cluster.Spec, clusterSpec *cluster.Spec) (controlPlaneSpec, workersSpec []byte, err error)

func (*SnowProvider) GenerateStorageClass added in v0.9.0

func (p *SnowProvider) GenerateStorageClass() []byte

func (*SnowProvider) GetDeployments added in v0.9.0

func (p *SnowProvider) GetDeployments() map[string][]string

func (*SnowProvider) GetInfrastructureBundle added in v0.9.0

func (p *SnowProvider) GetInfrastructureBundle(clusterSpec *cluster.Spec) *types.InfrastructureBundle

func (*SnowProvider) InstallCustomProviderComponents added in v0.9.0

func (p *SnowProvider) InstallCustomProviderComponents(ctx context.Context, kubeconfigFile string) error

func (*SnowProvider) MachineConfigs added in v0.9.0

func (p *SnowProvider) MachineConfigs(clusterSpec *cluster.Spec) []providers.MachineConfig

func (*SnowProvider) MachineResourceType added in v0.9.0

func (p *SnowProvider) MachineResourceType() string

func (*SnowProvider) Name added in v0.9.0

func (p *SnowProvider) Name() string

func (*SnowProvider) PostBootstrapDeleteForUpgrade added in v0.11.0

func (p *SnowProvider) PostBootstrapDeleteForUpgrade(ctx context.Context) error

func (*SnowProvider) PostBootstrapSetup added in v0.9.0

func (p *SnowProvider) PostBootstrapSetup(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error

func (*SnowProvider) PostBootstrapSetupUpgrade added in v0.9.2

func (p *SnowProvider) PostBootstrapSetupUpgrade(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error

func (*SnowProvider) PostClusterDeleteValidate added in v0.9.0

func (p *SnowProvider) PostClusterDeleteValidate(_ context.Context, _ *types.Cluster) error

func (*SnowProvider) PostWorkloadInit added in v0.9.2

func (p *SnowProvider) PostWorkloadInit(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*SnowProvider) PreCAPIInstallOnBootstrap added in v0.9.0

func (p *SnowProvider) PreCAPIInstallOnBootstrap(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*SnowProvider) RunPostControlPlaneUpgrade added in v0.9.0

func (p *SnowProvider) RunPostControlPlaneUpgrade(ctx context.Context, oldClusterSpec *cluster.Spec, clusterSpec *cluster.Spec, workloadCluster *types.Cluster, managementCluster *types.Cluster) error

func (*SnowProvider) SetupAndValidateCreateCluster added in v0.9.0

func (p *SnowProvider) SetupAndValidateCreateCluster(ctx context.Context, clusterSpec *cluster.Spec) error

func (*SnowProvider) SetupAndValidateDeleteCluster added in v0.9.0

func (p *SnowProvider) SetupAndValidateDeleteCluster(ctx context.Context, _ *types.Cluster) error

func (*SnowProvider) SetupAndValidateUpgradeCluster added in v0.9.0

func (p *SnowProvider) SetupAndValidateUpgradeCluster(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, _ *cluster.Spec) error

func (*SnowProvider) UpdateKubeConfig added in v0.9.0

func (p *SnowProvider) UpdateKubeConfig(content *[]byte, clusterName string) error

func (*SnowProvider) UpdateSecrets added in v0.9.0

func (p *SnowProvider) UpdateSecrets(ctx context.Context, cluster *types.Cluster) error

func (*SnowProvider) UpgradeNeeded added in v0.9.0

func (p *SnowProvider) UpgradeNeeded(ctx context.Context, newSpec, oldSpec *cluster.Spec, _ *types.Cluster) (bool, error)

func (*SnowProvider) ValidateNewSpec added in v0.9.0

func (p *SnowProvider) ValidateNewSpec(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error

func (*SnowProvider) Version added in v0.9.0

func (p *SnowProvider) Version(clusterSpec *cluster.Spec) string

type SshKeyGenerator added in v0.9.0

type SshKeyGenerator interface {
	GenerateSSHAuthKey(filewriter.FileWriter) (string, error)
}

type Validator added in v0.9.0

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

func NewValidator added in v0.9.0

func NewValidator(aws aws.Clients) *Validator

func NewValidatorFromAwsClientMap added in v0.9.0

func NewValidatorFromAwsClientMap(awsClientMap AwsClientMap) *Validator

func (*Validator) ValidateEC2ImageExistsOnDevice added in v0.9.0

func (v *Validator) ValidateEC2ImageExistsOnDevice(ctx context.Context, m *v1alpha1.SnowMachineConfig) error

func (*Validator) ValidateEC2SshKeyNameExists added in v0.9.0

func (v *Validator) ValidateEC2SshKeyNameExists(ctx context.Context, m *v1alpha1.SnowMachineConfig) error

func (*Validator) ValidateMachineDeviceIPs added in v0.11.1

func (v *Validator) ValidateMachineDeviceIPs(ctx context.Context, m *v1alpha1.SnowMachineConfig) error

Directories

Path Synopsis
api
v1beta1
Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +kubebuilder:object:generate=true +groupName=infrastructure.cluster.x-k8s.io
Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +kubebuilder:object:generate=true +groupName=infrastructure.cluster.x-k8s.io
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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