Documentation
¶
Index ¶
- Constants
- func CAPASCredentialsSecret(clusterSpec *cluster.Spec, credsB64, certsB64 []byte) *v1.Secret
- func CAPICluster(clusterSpec *cluster.Spec, snowCluster *snowv1.AWSSnowCluster, ...) *clusterv1.Cluster
- func CAPIObjects(ctx context.Context, log logr.Logger, clusterSpec *cluster.Spec, ...) (controlPlaneSpec, workersSpec []byte, err error)
- func ControlPlaneObjects(ctx context.Context, log logr.Logger, clusterSpec *cluster.Spec, ...) ([]kubernetes.Object, error)
- func CredentialsSecret(name, namespace string, credsB64, certsB64 []byte) *v1.Secret
- func CredentialsSecretName(clusterSpec *cluster.Spec) string
- func EksaCredentialsSecret(datacenter *v1alpha1.SnowDatacenterConfig, credsB64, certsB64 []byte) *v1.Secret
- func KubeadmConfigTemplate(log logr.Logger, clusterSpec *cluster.Spec, ...) (*bootstrapv1.KubeadmConfigTemplate, error)
- func KubeadmControlPlane(log logr.Logger, clusterSpec *cluster.Spec, ...) (*controlplanev1.KubeadmControlPlane, error)
- func MachineDeployments(clusterSpec *cluster.Spec, ...) map[string]*clusterv1.MachineDeployment
- func MachineTemplateDeepDerivative(new, old *snowv1.AWSSnowMachineTemplate) bool
- func NewKubeadmConfigTemplateName(new, old *bootstrapv1.KubeadmConfigTemplate) string
- func NewMachineTemplateName(new, old *snowv1.AWSSnowMachineTemplate) string
- func NewWorkerMachineTemplateName(newMt, oldMt *snowv1.AWSSnowMachineTemplate, ...) string
- func SetupEksaCredentialsSecret(c *cluster.Config) error
- func SnowCluster(clusterSpec *cluster.Spec, credentialsSecret *v1.Secret) *snowv1.AWSSnowCluster
- func SnowMachineTemplate(name string, machineConfig *v1alpha1.SnowMachineConfig) *snowv1.AWSSnowMachineTemplate
- func WorkersMachineAndConfigTemplate(ctx context.Context, log logr.Logger, kubeClient kubernetes.Client, ...) (map[string]*snowv1.AWSSnowMachineTemplate, ...)
- func WorkersObjects(ctx context.Context, log logr.Logger, clusterSpec *cluster.Spec, ...) ([]kubernetes.Object, error)
- type AwsClient
- type AwsClientMap
- type AwsClientRegistry
- type AwsClientValidator
- func (v *AwsClientValidator) ValidateDeviceIsUnlocked(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
- func (v *AwsClientValidator) ValidateDeviceSoftware(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
- func (v *AwsClientValidator) ValidateEC2ImageExistsOnDevice(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
- func (v *AwsClientValidator) ValidateEC2SshKeyNameExists(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
- type ClientRegistry
- type ConfigManager
- type Defaulters
- type DefaultersOpt
- type KubeUnAuthClient
- type MachineConfigDefaulters
- type SnowProvider
- func (p *SnowProvider) BootstrapClusterOpts(_ *cluster.Spec) ([]bootstrapper.BootstrapClusterOption, error)
- func (p *SnowProvider) ChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ComponentChangeDiff
- func (p *SnowProvider) DatacenterConfig(clusterSpec *cluster.Spec) providers.DatacenterConfig
- func (p *SnowProvider) DatacenterResourceType() string
- func (p *SnowProvider) DeleteResources(ctx context.Context, clusterSpec *cluster.Spec) error
- func (p *SnowProvider) EnvMap(clusterSpec *cluster.Spec) (map[string]string, error)
- func (p *SnowProvider) GenerateCAPISpecForCreate(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) (controlPlaneSpec, workersSpec []byte, err error)
- func (p *SnowProvider) GenerateCAPISpecForUpgrade(ctx context.Context, bootstrapCluster, _ *types.Cluster, _ *cluster.Spec, ...) (controlPlaneSpec, workersSpec []byte, err error)
- func (p *SnowProvider) GetDeployments() map[string][]string
- func (p *SnowProvider) GetInfrastructureBundle(clusterSpec *cluster.Spec) *types.InfrastructureBundle
- func (p *SnowProvider) InstallCustomProviderComponents(ctx context.Context, kubeconfigFile string) error
- func (p *SnowProvider) MachineConfigs(clusterSpec *cluster.Spec) []providers.MachineConfig
- func (p *SnowProvider) MachineResourceType() string
- func (p *SnowProvider) Name() string
- func (p *SnowProvider) PostBootstrapDeleteForUpgrade(ctx context.Context) error
- func (p *SnowProvider) PostBootstrapSetup(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error
- func (p *SnowProvider) PostBootstrapSetupUpgrade(ctx context.Context, clusterConfig *v1alpha1.Cluster, cluster *types.Cluster) error
- func (p *SnowProvider) PostClusterDeleteValidate(_ context.Context, _ *types.Cluster) error
- func (p *SnowProvider) PostMoveManagementToBootstrap(_ context.Context, _ *types.Cluster) error
- func (p *SnowProvider) PostWorkloadInit(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *SnowProvider) PreCAPIInstallOnBootstrap(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *SnowProvider) RunPostControlPlaneUpgrade(ctx context.Context, oldClusterSpec *cluster.Spec, clusterSpec *cluster.Spec, ...) error
- func (p *SnowProvider) SetupAndValidateCreateCluster(ctx context.Context, clusterSpec *cluster.Spec) error
- func (p *SnowProvider) SetupAndValidateDeleteCluster(ctx context.Context, _ *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *SnowProvider) SetupAndValidateUpgradeCluster(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, ...) error
- func (p *SnowProvider) UpdateKubeConfig(content *[]byte, clusterName string) error
- func (p *SnowProvider) UpdateSecrets(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *SnowProvider) UpgradeNeeded(ctx context.Context, newSpec, oldSpec *cluster.Spec, _ *types.Cluster) (bool, error)
- func (p *SnowProvider) ValidateNewSpec(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec) error
- func (p *SnowProvider) Version(clusterSpec *cluster.Spec) string
- type SshKeyGenerator
- type Workers
Constants ¶
const ( SnowClusterKind = "AWSSnowCluster" SnowMachineTemplateKind = "AWSSnowMachineTemplate" )
Variables ¶
This section is empty.
Functions ¶
func CAPASCredentialsSecret ¶ added in v0.12.0
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, log logr.Logger, clusterSpec *cluster.Spec, kubeClient kubernetes.Client) (controlPlaneSpec, workersSpec []byte, err error)
CAPIObjects generates the control plane and worker nodes objects for snow provider from clusterSpec.
func ControlPlaneObjects ¶
func ControlPlaneObjects(ctx context.Context, log logr.Logger, clusterSpec *cluster.Spec, kubeClient kubernetes.Client) ([]kubernetes.Object, error)
ControlPlaneObjects generates the control plane objects for snow provider from clusterSpec.
func CredentialsSecret ¶ added in v0.12.0
func CredentialsSecretName ¶ added in v0.12.0
func EksaCredentialsSecret ¶ added in v0.12.0
func EksaCredentialsSecret(datacenter *v1alpha1.SnowDatacenterConfig, credsB64, certsB64 []byte) *v1.Secret
func KubeadmConfigTemplate ¶ added in v0.11.0
func KubeadmConfigTemplate(log logr.Logger, clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) (*bootstrapv1.KubeadmConfigTemplate, error)
KubeadmConfigTemplate generates the kubeadmConfigTemplate object for snow provider from clusterSpec and workerNodeGroupConfig.
func KubeadmControlPlane ¶
func KubeadmControlPlane(log logr.Logger, clusterSpec *cluster.Spec, snowMachineTemplate *snowv1.AWSSnowMachineTemplate) (*controlplanev1.KubeadmControlPlane, error)
KubeadmControlPlane generates the kubeadmControlPlane object for snow provider from clusterSpec and snowMachineTemplate.
func MachineDeployments ¶
func MachineDeployments(clusterSpec *cluster.Spec, kubeadmConfigTemplates map[string]*bootstrapv1.KubeadmConfigTemplate, machineTemplates map[string]*snowv1.AWSSnowMachineTemplate) map[string]*clusterv1.MachineDeployment
func MachineTemplateDeepDerivative ¶ added in v0.12.0
func MachineTemplateDeepDerivative(new, old *snowv1.AWSSnowMachineTemplate) bool
MachineTemplateDeepDerivative compares two awssnowmachinetemplates to determine if their spec fields are equal. DeepDerivative is used so that unset fields in new object are not compared. Although DeepDerivative treats new subset slice equal to the original slice. i.e. DeepDerivative([]int{1}, []int{1, 2}) returns true. Custom logic is added to justify this usecase since removing a device from the devices list shall trigger machine rollout and recreate or the snow cluster goes into a state where the machines on the removed device can’t be deleted.
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
NewMachineTemplateName compares the existing awssnowmachinetemplate object in the cluster with the awssnowmachinetemplate constructed from cluster spec, to figure out whether a new awssnowmachinetemplate needs to be created. Return the awssnowmachinetemplate name.
func NewWorkerMachineTemplateName ¶ added in v0.9.2
func NewWorkerMachineTemplateName(newMt, oldMt *snowv1.AWSSnowMachineTemplate, newKct, oldKct *bootstrapv1.KubeadmConfigTemplate) string
func SetupEksaCredentialsSecret ¶ added in v0.12.0
func SnowCluster ¶
func SnowMachineTemplate ¶
func SnowMachineTemplate(name string, machineConfig *v1alpha1.SnowMachineConfig) *snowv1.AWSSnowMachineTemplate
func WorkersMachineAndConfigTemplate ¶ added in v0.9.2
func WorkersMachineAndConfigTemplate(ctx context.Context, log logr.Logger, kubeClient kubernetes.Client, clusterSpec *cluster.Spec) (map[string]*snowv1.AWSSnowMachineTemplate, map[string]*bootstrapv1.KubeadmConfigTemplate, error)
WorkersMachineAndConfigTemplate generates the snowMachineTemplates and kubeadmConfigTemplates from clusterSpec.
func WorkersObjects ¶
func WorkersObjects(ctx context.Context, log logr.Logger, clusterSpec *cluster.Spec, kubeClient kubernetes.Client) ([]kubernetes.Object, error)
WorkersObjects generates all the objects that compose a Snow specific CAPI spec for the worker nodes of an eks-a cluster.
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 IsSnowballDeviceUnlocked(ctx context.Context) (bool, error) SnowballDeviceSoftwareVersion(ctx context.Context) (string, error) }
type AwsClientMap ¶ added in v0.9.0
func NewAwsClientMap ¶ added in v0.9.0
func NewAwsClientMap(awsClients aws.Clients) AwsClientMap
type AwsClientRegistry ¶ added in v0.11.0
type AwsClientRegistry struct {
// contains filtered or unexported fields
}
func NewAwsClientRegistry ¶ added in v0.11.0
func NewAwsClientRegistry() *AwsClientRegistry
func (*AwsClientRegistry) Build ¶ added in v0.11.0
func (b *AwsClientRegistry) Build(ctx context.Context) error
Build creates the device client map based on the filepaths specified. This method must be called before any Get operations.
func (*AwsClientRegistry) Get ¶ added in v0.11.0
func (b *AwsClientRegistry) Get(ctx context.Context) (AwsClientMap, error)
type AwsClientValidator ¶ added in v0.11.0
type AwsClientValidator struct {
// contains filtered or unexported fields
}
func NewValidator ¶ added in v0.9.0
func NewValidator(clientRegistry ClientRegistry) *AwsClientValidator
func (*AwsClientValidator) ValidateDeviceIsUnlocked ¶ added in v0.12.0
func (v *AwsClientValidator) ValidateDeviceIsUnlocked(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
func (*AwsClientValidator) ValidateDeviceSoftware ¶ added in v0.12.0
func (v *AwsClientValidator) ValidateDeviceSoftware(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
func (*AwsClientValidator) ValidateEC2ImageExistsOnDevice ¶ added in v0.11.0
func (v *AwsClientValidator) ValidateEC2ImageExistsOnDevice(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
func (*AwsClientValidator) ValidateEC2SshKeyNameExists ¶ added in v0.11.0
func (v *AwsClientValidator) ValidateEC2SshKeyNameExists(ctx context.Context, m *v1alpha1.SnowMachineConfig) error
type ClientRegistry ¶ added in v0.11.0
type ClientRegistry interface {
Get(ctx context.Context) (AwsClientMap, error)
}
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 *AwsClientValidator) *ConfigManager
func (*ConfigManager) SetDefaultsAndValidate ¶ added in v0.9.0
type Defaulters ¶ added in v0.9.0
type Defaulters struct {
// contains filtered or unexported fields
}
func NewDefaulters ¶ added in v0.9.0
func NewDefaulters(clientRegistry ClientRegistry, writer filewriter.FileWriter, opts ...DefaultersOpt) *Defaulters
func (*Defaulters) GenerateDefaultSshKeys ¶ added in v0.9.0
func (d *Defaulters) GenerateDefaultSshKeys(ctx context.Context, machineConfigs map[string]*v1alpha1.SnowMachineConfig) error
type DefaultersOpt ¶ added in v0.11.0
type DefaultersOpt func(defaulters *Defaulters)
func WithKeyGenerator ¶ added in v0.11.0
func WithKeyGenerator(generator SshKeyGenerator) DefaultersOpt
type KubeUnAuthClient ¶ added in v0.9.0
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 (*SnowProvider) GenerateCAPISpecForCreate ¶ added in v0.9.0
func (*SnowProvider) GenerateCAPISpecForUpgrade ¶ added in v0.9.0
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 (*SnowProvider) PostBootstrapSetupUpgrade ¶ added in v0.9.2
func (*SnowProvider) PostClusterDeleteValidate ¶ added in v0.9.0
func (*SnowProvider) PostMoveManagementToBootstrap ¶ added in v0.12.0
func (*SnowProvider) PostWorkloadInit ¶ added in v0.9.2
func (*SnowProvider) PreCAPIInstallOnBootstrap ¶ added in v0.9.0
func (*SnowProvider) RunPostControlPlaneUpgrade ¶ added in v0.9.0
func (*SnowProvider) SetupAndValidateCreateCluster ¶ added in v0.9.0
func (*SnowProvider) SetupAndValidateDeleteCluster ¶ added in v0.9.0
func (*SnowProvider) SetupAndValidateUpgradeCluster ¶ added in v0.9.0
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 (*SnowProvider) UpgradeNeeded ¶ added in v0.9.0
func (*SnowProvider) ValidateNewSpec ¶ added in v0.9.0
type SshKeyGenerator ¶ added in v0.9.0
type SshKeyGenerator interface {
GenerateSSHAuthKey(filewriter.FileWriter) (string, error)
}
type Workers ¶ added in v0.13.0
type Workers = clusterapi.Workers[*snowv1.AWSSnowMachineTemplate]
Workers represents the Snow specific CAPI spec for worker nodes.
func WorkersSpec ¶ added in v0.13.0
func WorkersSpec(ctx context.Context, log logr.Logger, spec *cluster.Spec, kubeClient kubernetes.Client) (*Workers, error)
WorkersSpec generates a Snow specific CAPI spec for an eks-a cluster worker nodes. It talks to the cluster with a client to detect changes in immutable objects and generates new names for them.