clusterapi

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EKSAClusterLabelName      = "cluster.anywhere.eks.amazonaws.com/cluster-name"
	EKSAClusterLabelNamespace = "cluster.anywhere.eks.amazonaws.com/cluster-namespace"
)
View Source
const (
	ControlPlaneReadyCondition clusterv1.ConditionType = "ControlPlaneReady"
)

Variables

This section is empty.

Functions

func CapiChangeDiff added in v0.7.0

func CapiChangeDiff(currentSpec, newSpec *cluster.Spec, provider providers.Provider) *types.ChangeDiff

func Cluster added in v0.8.0

func Cluster(clusterSpec *cluster.Spec, infrastructureObject, controlPlaneObject, unstackedEtcdObject APIObject) *clusterv1.Cluster

Cluster builds a CAPI Cluster based on an eks-a cluster spec, infrastructureObject, controlPlaneObject and unstackedEtcdObject.

func ClusterCASecretName added in v0.13.0

func ClusterCASecretName(clusterName string) string

ClusterCASecretName returns the name of the cluster CA secret for the cluster.

func ClusterName added in v0.9.2

func ClusterName(cluster *anywherev1.Cluster) string

ClusterName generates the CAPI cluster name for an EKSA Cluster.

func ConfigureAutoscalingInMachineDeployment added in v0.12.0

func ConfigureAutoscalingInMachineDeployment(md *clusterv1.MachineDeployment, autoscalingConfig *anywherev1.AutoScalingConfiguration)

func ControlPlaneMachineHealthCheckName added in v0.11.0

func ControlPlaneMachineHealthCheckName(cluster *v1alpha1.Cluster) string

ControlPlaneMachineHealthCheckName returns a name for a kcp machine health check.

func ControlPlaneMachineTemplateName added in v0.9.2

func ControlPlaneMachineTemplateName(cluster *v1alpha1.Cluster) string

ControlPlaneMachineTemplateName sets the default object name on the control plane machine template.

func CreateContainerdConfigFileInKubeadmConfigTemplate added in v0.9.2

func CreateContainerdConfigFileInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster *v1alpha1.Cluster)

CreateContainerdConfigFileInKubeadmConfigTemplate adds the prekubeadm command to create containerd config file in kubeadmConfigTemplate if registry mirror config exists.

func CreateContainerdConfigFileInKubeadmControlPlane added in v0.9.2

func CreateContainerdConfigFileInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster *v1alpha1.Cluster)

CreateContainerdConfigFileInKubeadmControlPlane adds the prekubeadm command to create containerd config file in kubeadmControlPlane if registry mirror config exists.

func DefaultKubeadmConfigTemplateName added in v0.9.2

func DefaultKubeadmConfigTemplateName(clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string

func DefaultObjectName added in v0.9.0

func DefaultObjectName(baseName string) string

func EnsureNewNameIfChanged added in v0.12.0

func EnsureNewNameIfChanged[M Object[M]](ctx context.Context,
	client kubernetes.Client,
	retrieve ObjectRetriever[M],
	equal ObjectComparator[M],
	new M,
) error

EnsureNewNameIfChanged updates an object's name if such object is different from its current state in the cluster.

func EtcdClusterName added in v0.14.0

func EtcdClusterName(clusterName string) string

EtcdClusterName sets the default EtcdCluster object name.

func EtcdMachineTemplateName added in v0.13.0

func EtcdMachineTemplateName(cluster *v1alpha1.Cluster) string

EtcdMachineTemplateName sets the default object name on the etcd machine template.

func EtcdadmCluster added in v0.14.0

func EtcdadmCluster(clusterSpec *cluster.Spec, infrastructureTemplate APIObject) *etcdv1.EtcdadmCluster

EtcdadmCluster builds a etcdadmCluster based on an eks-a cluster spec and infrastructureTemplate.

func GetKubeadmConfigTemplate added in v0.12.0

func GetKubeadmConfigTemplate(ctx context.Context, client kubernetes.Client, name, namespace string) (*kubeadmv1.KubeadmConfigTemplate, error)

GetKubeadmConfigTemplate retrieves a KubeadmConfigTemplate using a client Implements ObjectRetriever.

func GetProviders added in v0.11.0

func GetProviders(ctx context.Context, client KubeLister) ([]clusterctlv1.Provider, error)

GetProviders lists all installed CAPI providers across all namespaces from the kube-api server.

func IncrementName added in v0.9.0

func IncrementName(name string) (string, error)

IncrementName takes an object name and increments the suffix number by one. This method is used for updating objects (e.g. machinetemplate, kubeadmconfigtemplate) that are either immutable or require recreation to trigger machine rollout. The original object name should follow the name convention of alphanumeric followed by dash digits, e.g. abc-1, md-0, kct-2. An error will be raised if the original name does not follow this pattern.

func IncrementNameWithFallbackDefault added in v0.11.0

func IncrementNameWithFallbackDefault(name, defaultName string) string

IncrementNameWithFallbackDefault calls the IncrementName and fallbacks to use the default name if IncrementName returns an error. This method is used to accommodate for any objects with name breaking changes from a previous version. For example, in beta capi snowmachinetemplate is named after the eks-a snowmachineconfig name, without the '-1' suffix. We set the object name to the default new machinetemplate name after detecting the invalid old name.

func InfrastructureAPIVersion added in v0.8.0

func InfrastructureAPIVersion() string

func InitialTemplateNamesForWorkers added in v0.16.0

func InitialTemplateNamesForWorkers(clusterSpec *cluster.Spec) (machineTemplateNames, kubeadmConfigTemplateNames map[string]string)

InitialTemplateNamesForWorkers returns the default initial names for workers machine templates and kubeadm config templates.

func KubeadmConfigTemplate added in v0.8.0

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

func KubeadmConfigTemplateEqual added in v0.12.0

func KubeadmConfigTemplateEqual(new, old *kubeadmv1.KubeadmConfigTemplate) bool

KubeadmConfigTemplateEqual returns true only if the new version of a KubeadmConfigTemplate involves changes with respect to the old one when applied to the cluster. Implements ObjectComparator.

func KubeadmConfigTemplateInCluster added in v0.9.2

func KubeadmConfigTemplateInCluster(ctx context.Context, kubeclient KubeClient, md *clusterv1.MachineDeployment) (*bootstrapv1.KubeadmConfigTemplate, error)

func KubeadmControlPlane added in v0.8.0

func KubeadmControlPlane(clusterSpec *cluster.Spec, infrastructureObject APIObject) (*controlplanev1.KubeadmControlPlane, error)

func KubeadmControlPlaneName added in v0.9.0

func KubeadmControlPlaneName(cluster *v1alpha1.Cluster) string

KubeadmControlPlaneName generates the kubeadmControlPlane name for an EKSA Cluster.

func MachineDeployment added in v0.8.0

func MachineDeployment(clusterSpec *cluster.Spec, workerNodeGroupConfig anywherev1.WorkerNodeGroupConfiguration, bootstrapObject, infrastructureObject APIObject) *clusterv1.MachineDeployment

MachineDeployment builds a machineDeployment based on an eks-a cluster spec, workerNodeGroupConfig, bootstrapObject and infrastructureObject.

func MachineDeploymentInCluster added in v0.9.2

func MachineDeploymentInCluster(ctx context.Context, kubeclient KubeClient, clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) (*clusterv1.MachineDeployment, error)

func MachineDeploymentName added in v0.9.0

func MachineDeploymentName(cluster *v1alpha1.Cluster, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string

MachineDeploymentName returns the name for the corresponding MachineDeployment to an EKS-A worker node group.

func MachineHealthCheckForControlPlane added in v0.11.0

func MachineHealthCheckForControlPlane(cluster *v1alpha1.Cluster) *clusterv1.MachineHealthCheck

MachineHealthCheckForControlPlane creates MachineHealthCheck resources for the control plane.

func MachineHealthCheckForWorkers added in v0.11.0

func MachineHealthCheckForWorkers(cluster *v1alpha1.Cluster) []*clusterv1.MachineHealthCheck

MachineHealthCheckForWorkers creates MachineHealthCheck resources for the workers.

func MachineHealthCheckObjects added in v0.11.0

func MachineHealthCheckObjects(cluster *v1alpha1.Cluster) []kubernetes.Object

MachineHealthCheckObjects creates MachineHealthCheck resources for control plane and all the worker node groups.

func NoProxyDefaults added in v0.9.2

func NoProxyDefaults() []string

func ObjectName added in v0.9.0

func ObjectName(baseName string, version int) string

func RestartContainerdInKubeadmConfigTemplate added in v0.9.2

func RestartContainerdInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster *v1alpha1.Cluster)

RestartContainerdInKubeadmConfigTemplate adds the prekubeadm command to restart containerd daemon in kubeadmConfigTemplate if registry mirror or proxy config exists.

func RestartContainerdInKubeadmControlPlane added in v0.9.2

func RestartContainerdInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster *v1alpha1.Cluster)

RestartContainerdInKubeadmControlPlane adds the prekubeadm command to restart containerd daemon in kubeadmControlPlane if registry mirror or proxy config exists.

func SetBottlerocketAdminContainerImageInEtcdCluster added in v0.14.0

func SetBottlerocketAdminContainerImageInEtcdCluster(etcd *etcdv1.EtcdadmCluster, adminImage v1alpha1.Image)

SetBottlerocketAdminContainerImageInEtcdCluster overrides the default bottlerocket admin container image metadata in etcdadmCluster.

func SetBottlerocketAdminContainerImageInKubeadmConfigTemplate added in v0.13.0

func SetBottlerocketAdminContainerImageInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, versionsBundle *cluster.VersionsBundle)

SetBottlerocketAdminContainerImageInKubeadmConfigTemplate overrides the default bottlerocket admin container image metadata in kubeadmConfigTemplate.

func SetBottlerocketAdminContainerImageInKubeadmControlPlane added in v0.13.0

func SetBottlerocketAdminContainerImageInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, versionsBundle *cluster.VersionsBundle)

SetBottlerocketAdminContainerImageInKubeadmControlPlane overrides the default bottlerocket admin container image metadata in kubeadmControlPlane.

func SetBottlerocketControlContainerImageInEtcdCluster added in v0.14.0

func SetBottlerocketControlContainerImageInEtcdCluster(etcd *etcdv1.EtcdadmCluster, controlImage v1alpha1.Image)

SetBottlerocketControlContainerImageInEtcdCluster overrides the default bottlerocket control container image metadata in etcdadmCluster.

func SetBottlerocketControlContainerImageInKubeadmConfigTemplate added in v0.13.0

func SetBottlerocketControlContainerImageInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, versionsBundle *cluster.VersionsBundle)

SetBottlerocketControlContainerImageInKubeadmConfigTemplate overrides the default bottlerocket control container image metadata in kubeadmConfigTemplate.

func SetBottlerocketControlContainerImageInKubeadmControlPlane added in v0.13.0

func SetBottlerocketControlContainerImageInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, versionsBundle *cluster.VersionsBundle)

SetBottlerocketControlContainerImageInKubeadmControlPlane overrides the default bottlerocket control container image metadata in kubeadmControlPlane.

func SetBottlerocketHostConfigInEtcdCluster added in v0.15.0

func SetBottlerocketHostConfigInEtcdCluster(etcd *etcdv1.EtcdadmCluster, hostOSConfig *anywherev1.HostOSConfiguration)

SetBottlerocketHostConfigInEtcdCluster sets bottlerocket specific kernel settings in etcdadmCluster.

func SetBottlerocketHostConfigInKubeadmConfigTemplate added in v0.15.0

func SetBottlerocketHostConfigInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, hostOSConfig *anywherev1.HostOSConfiguration)

SetBottlerocketHostConfigInKubeadmConfigTemplate sets bottlerocket specific kernel settings in kubeadmConfigTemplate.

func SetBottlerocketHostConfigInKubeadmControlPlane added in v0.15.0

func SetBottlerocketHostConfigInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, hostOSConfig *anywherev1.HostOSConfiguration)

SetBottlerocketHostConfigInKubeadmControlPlane sets bottlerocket specific kernel settings in kubeadmControlPlane.

func SetBottlerocketInEtcdCluster added in v0.14.0

func SetBottlerocketInEtcdCluster(etcd *etcdv1.EtcdadmCluster, versionsBundle *cluster.VersionsBundle)

SetBottlerocketInEtcdCluster adds bottlerocket config in etcdadmCluster.

func SetBottlerocketInKubeadmConfigTemplate added in v0.13.0

func SetBottlerocketInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, versionsBundle *cluster.VersionsBundle)

SetBottlerocketInKubeadmConfigTemplate adds bottlerocket bootstrap image metadata in kubeadmConfigTemplate.

func SetBottlerocketInKubeadmControlPlane added in v0.13.0

func SetBottlerocketInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, versionsBundle *cluster.VersionsBundle)

SetBottlerocketInKubeadmControlPlane adds bottlerocket bootstrap image metadata in kubeadmControlPlane.

func SetIdentityAuthInKubeadmControlPlane added in v0.9.0

func SetIdentityAuthInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, clusterSpec *cluster.Spec)

func SetKubeVipInKubeadmControlPlane added in v0.13.0

func SetKubeVipInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, address, image string) error

SetKubeVipInKubeadmControlPlane appends kube-vip manifest to kubeadmControlPlane's kubeadmConfigSpec files.

func SetProxyConfigInKubeadmConfigTemplateForBottlerocket added in v0.13.0

func SetProxyConfigInKubeadmConfigTemplateForBottlerocket(kct *bootstrapv1.KubeadmConfigTemplate, cluster *v1alpha1.Cluster)

SetProxyConfigInKubeadmConfigTemplateForBottlerocket sets up proxy configuration in kubeadmConfigTemplate for bottlerocket.

func SetProxyConfigInKubeadmConfigTemplateForUbuntu added in v0.13.0

func SetProxyConfigInKubeadmConfigTemplateForUbuntu(kct *bootstrapv1.KubeadmConfigTemplate, cluster *v1alpha1.Cluster) error

SetProxyConfigInKubeadmConfigTemplateForUbuntu sets up proxy configuration in kubeadmConfigTemplate for ubuntu.

func SetProxyConfigInKubeadmControlPlaneForBottlerocket added in v0.13.0

func SetProxyConfigInKubeadmControlPlaneForBottlerocket(kcp *controlplanev1.KubeadmControlPlane, cluster *v1alpha1.Cluster)

SetProxyConfigInKubeadmControlPlaneForBottlerocket sets up proxy configuration in kubeadmControlPlane for bottlerocket.

func SetProxyConfigInKubeadmControlPlaneForUbuntu added in v0.13.0

func SetProxyConfigInKubeadmControlPlaneForUbuntu(kcp *controlplanev1.KubeadmControlPlane, cluster *v1alpha1.Cluster) error

SetProxyConfigInKubeadmControlPlaneForUbuntu sets up proxy configuration in kubeadmControlPlane for ubuntu.

func SetRegistryMirrorInKubeadmConfigTemplateForBottlerocket added in v0.13.0

func SetRegistryMirrorInKubeadmConfigTemplateForBottlerocket(kct *bootstrapv1.KubeadmConfigTemplate, mirrorConfig *v1alpha1.RegistryMirrorConfiguration)

SetRegistryMirrorInKubeadmConfigTemplateForBottlerocket sets up registry mirror configuration in kubeadmConfigTemplate for bottlerocket.

func SetRegistryMirrorInKubeadmConfigTemplateForUbuntu added in v0.13.0

func SetRegistryMirrorInKubeadmConfigTemplateForUbuntu(kct *bootstrapv1.KubeadmConfigTemplate, mirrorConfig *v1alpha1.RegistryMirrorConfiguration) error

SetRegistryMirrorInKubeadmConfigTemplateForUbuntu sets up registry mirror configuration in kubeadmConfigTemplate for ubuntu.

func SetRegistryMirrorInKubeadmControlPlaneForBottlerocket added in v0.13.0

func SetRegistryMirrorInKubeadmControlPlaneForBottlerocket(kcp *controlplanev1.KubeadmControlPlane, mirrorConfig *v1alpha1.RegistryMirrorConfiguration)

SetRegistryMirrorInKubeadmControlPlaneForBottlerocket sets up registry mirror configuration in kubeadmControlPlane for bottlerocket.

func SetRegistryMirrorInKubeadmControlPlaneForUbuntu added in v0.13.0

func SetRegistryMirrorInKubeadmControlPlaneForUbuntu(kcp *controlplanev1.KubeadmControlPlane, mirrorConfig *v1alpha1.RegistryMirrorConfiguration) error

SetRegistryMirrorInKubeadmControlPlaneForUbuntu sets up registry mirror configuration in kubeadmControlPlane for ubuntu.

func SetUbuntuConfigInEtcdCluster added in v0.14.0

func SetUbuntuConfigInEtcdCluster(etcd *etcdv1.EtcdadmCluster, version string)

SetUbuntuConfigInEtcdCluster sets up the etcd config in EtcdadmCluster.

func SetUnstackedEtcdConfigInKubeadmControlPlaneForBottlerocket added in v0.14.0

func SetUnstackedEtcdConfigInKubeadmControlPlaneForBottlerocket(kcp *controlplanev1.KubeadmControlPlane, externalEtcdConfig *v1alpha1.ExternalEtcdConfiguration)

SetUnstackedEtcdConfigInKubeadmControlPlaneForBottlerocket sets up unstacked etcd configuration in kubeadmControlPlane for bottlerocket.

func SetUnstackedEtcdConfigInKubeadmControlPlaneForUbuntu added in v0.14.0

func SetUnstackedEtcdConfigInKubeadmControlPlaneForUbuntu(kcp *controlplanev1.KubeadmControlPlane, externalEtcdConfig *v1alpha1.ExternalEtcdConfiguration)

SetUnstackedEtcdConfigInKubeadmControlPlaneForUbuntu sets up unstacked etcd configuration in kubeadmControlPlane for ubuntu.

func WorkerMachineHealthCheckName added in v0.11.0

func WorkerMachineHealthCheckName(cluster *v1alpha1.Cluster, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string

WorkerMachineHealthCheckName returns a name for a worker machine health check.

func WorkerMachineTemplateName added in v0.9.2

func WorkerMachineTemplateName(clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string

Types

type APIObject added in v0.8.0

type APIObject interface {
	runtime.Object
	GetName() string
}

type CAPIChangeDiff added in v0.6.0

type CAPIChangeDiff struct {
	CertManager            *types.ComponentChangeDiff
	Core                   *types.ComponentChangeDiff
	ControlPlane           *types.ComponentChangeDiff
	BootstrapProviders     []types.ComponentChangeDiff
	InfrastructureProvider *types.ComponentChangeDiff
}

type CAPIClient added in v0.6.0

type CAPIClient interface {
	Upgrade(ctx context.Context, managementCluster *types.Cluster, provider providers.Provider, newSpec *cluster.Spec, changeDiff *CAPIChangeDiff) error
	InstallEtcdadmProviders(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster, provider providers.Provider, installProviders []string) error
}

type ClusterResourceSet

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

func NewClusterResourceSet

func NewClusterResourceSet(clusterName string) *ClusterResourceSet

func (ClusterResourceSet) AddResource

func (c ClusterResourceSet) AddResource(name string, content []byte)

func (ClusterResourceSet) ToYaml

func (c ClusterResourceSet) ToYaml() ([]byte, error)

type ControlPlane added in v0.12.0

type ControlPlane[C Object[C], M Object[M]] struct {
	Cluster *clusterv1.Cluster

	// ProviderCluster is the provider-specific resource that holds the details
	// for provisioning the infrastructure, referenced in Cluster.Spec.InfrastructureRef
	ProviderCluster C

	KubeadmControlPlane *controlplanev1.KubeadmControlPlane

	// ControlPlaneMachineTemplate is the provider-specific machine template referenced
	// in KubeadmControlPlane.Spec.MachineTemplate.InfrastructureRef
	ControlPlaneMachineTemplate M

	EtcdCluster *etcdv1.EtcdadmCluster

	// EtcdMachineTemplate is the provider-specific machine template referenced
	// in EtcdCluster.Spec.InfrastructureTemplate
	EtcdMachineTemplate M
}

ControlPlane represents the provider-specific spec for a CAPI control plane using the kubeadm CP provider.

func (*ControlPlane[C, M]) Objects added in v0.12.0

func (cp *ControlPlane[C, M]) Objects() []kubernetes.Object

Objects returns all API objects that form a concrete provider-specific control plane.

func (*ControlPlane[C, M]) UpdateImmutableObjectNames added in v0.12.0

func (cp *ControlPlane[C, M]) UpdateImmutableObjectNames(
	ctx context.Context,
	client kubernetes.Client,
	machineTemplateRetriever ObjectRetriever[M],
	machineTemplateComparator ObjectComparator[M],
) error

UpdateImmutableObjectNames checks if any control plane immutable objects have changed by comparing the new definition with the current state of the cluster. If they had, it generates a new name for them by increasing a monotonic number at the end of the name This is applied to all provider machine templates.

type ExtraArgs

type ExtraArgs map[string]string

func AwsIamAuthExtraArgs added in v0.6.0

func AwsIamAuthExtraArgs(awsiam *v1alpha1.AWSIamConfig) ExtraArgs

func CgroupDriverCgroupfsExtraArgs added in v0.13.0

func CgroupDriverCgroupfsExtraArgs() ExtraArgs

CgroupDriverExtraArgs args added for kube versions below 1.24.

func CgroupDriverSystemdExtraArgs added in v0.13.0

func CgroupDriverSystemdExtraArgs() ExtraArgs

CgroupDriverSystemdExtraArgs args added for kube versions 1.24 and above.

func ControlPlaneNodeLabelsExtraArgs added in v0.7.0

func ControlPlaneNodeLabelsExtraArgs(cpc v1alpha1.ControlPlaneConfiguration) ExtraArgs

func ControllerManagerArgs added in v0.9.2

func ControllerManagerArgs(clusterSpec *cluster.Spec) ExtraArgs

func FeatureGatesExtraArgs added in v0.11.0

func FeatureGatesExtraArgs(features ...string) ExtraArgs

FeatureGatesExtraArgs takes a list of features with the value and returns it in the proper format Example FeatureGatesExtraArgs("ServiceLoadBalancerClass=true").

func NodeCIDRMaskExtraArgs added in v0.9.2

func NodeCIDRMaskExtraArgs(clusterNetwork *v1alpha1.ClusterNetwork) ExtraArgs

func OIDCToExtraArgs

func OIDCToExtraArgs(oidc *v1alpha1.OIDCConfig) ExtraArgs

func PodIAMAuthExtraArgs added in v0.6.1

func PodIAMAuthExtraArgs(podIAMConfig *v1alpha1.PodIAMConfig) ExtraArgs

func ResolvConfExtraArgs added in v0.7.0

func ResolvConfExtraArgs(resolvConf *v1alpha1.ResolvConf) ExtraArgs

func SecureEtcdTlsCipherSuitesExtraArgs added in v0.7.0

func SecureEtcdTlsCipherSuitesExtraArgs() ExtraArgs

func SecureTlsCipherSuitesExtraArgs added in v0.7.0

func SecureTlsCipherSuitesExtraArgs() ExtraArgs

We don't need to add these once the Kubernetes components default to using the secure cipher suites.

func WorkerNodeLabelsExtraArgs added in v0.7.0

func WorkerNodeLabelsExtraArgs(wnc v1alpha1.WorkerNodeGroupConfiguration) ExtraArgs

func (ExtraArgs) AddIfNotEmpty

func (e ExtraArgs) AddIfNotEmpty(k, v string)

func (ExtraArgs) Append added in v0.6.0

func (e ExtraArgs) Append(args ExtraArgs) ExtraArgs

func (ExtraArgs) ToPartialYaml

func (e ExtraArgs) ToPartialYaml() templater.PartialYaml

type Installer added in v0.6.0

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

func NewInstaller added in v0.6.0

func NewInstaller(capiClient CAPIClient, kubectlClient KubectlClient) *Installer

func (*Installer) EnsureEtcdProvidersInstallation added in v0.6.0

func (i *Installer) EnsureEtcdProvidersInstallation(ctx context.Context, managementCluster *types.Cluster, provider providers.Provider, currSpec *cluster.Spec) error

type KubeClient added in v0.9.2

type KubeClient interface {
	Get(ctx context.Context, name, namespace string, obj kubernetes.Object) error
}

KubeClient is a kubernetes API client.

type KubeLister added in v0.11.0

type KubeLister interface {
	List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
}

type KubectlClient added in v0.6.0

type KubectlClient interface {
	CheckProviderExists(ctx context.Context, kubeconfigFile, name, namespace string) (bool, error)
}

type Manager added in v0.6.0

type Manager struct {
	*Installer
	*Upgrader
}

func NewManager added in v0.6.0

func NewManager(capiClient CAPIClient, kubectlClient KubectlClient) *Manager

type Object added in v0.12.0

type Object[O kubernetes.Object] interface {
	kubernetes.Object
	DeepCopy() O
}

Object represents a kubernetes API object.

type ObjectComparator added in v0.12.0

type ObjectComparator[O Object[O]] func(current, new O) bool

ObjectComparator returns true only if only both kubernetes Object's are identical Most of the time, this only requires comparing the Spec field, but that can variate from object to object.

type ObjectRetriever added in v0.12.0

type ObjectRetriever[O Object[O]] func(ctx context.Context, client kubernetes.Client, name, namespace string) (O, error)

ObjectRetriever gets a kubernetes API object using the provided client If the object doesn't exist, it returns a NotFound error.

type Upgrader added in v0.6.0

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

func NewUpgrader added in v0.6.0

func NewUpgrader(capiClient CAPIClient, kubectlClient KubectlClient) *Upgrader

func (*Upgrader) Upgrade added in v0.6.0

func (u *Upgrader) Upgrade(ctx context.Context, managementCluster *types.Cluster, provider providers.Provider, currentSpec, newSpec *cluster.Spec) (*types.ChangeDiff, error)

type WorkerGroup added in v0.12.0

type WorkerGroup[M Object[M]] struct {
	KubeadmConfigTemplate   *kubeadmv1.KubeadmConfigTemplate
	MachineDeployment       *clusterv1.MachineDeployment
	ProviderMachineTemplate M
}

WorkerGroup represents the provider specific CAPI spec for an eks-a worker group.

func (*WorkerGroup[M]) DeepCopy added in v0.13.0

func (g *WorkerGroup[M]) DeepCopy() *WorkerGroup[M]

DeepCopy generates a new WorkerGroup copying the contexts of the receiver.

func (*WorkerGroup[M]) Objects added in v0.13.0

func (g *WorkerGroup[M]) Objects() []kubernetes.Object

Objects returns a list of API objects for a provider-specific of the worker group.

func (*WorkerGroup[M]) UpdateImmutableObjectNames added in v0.12.0

func (g *WorkerGroup[M]) UpdateImmutableObjectNames(
	ctx context.Context,
	client kubernetes.Client,
	machineTemplateRetriever ObjectRetriever[M],
	machineTemplateComparator ObjectComparator[M],
) error

UpdateImmutableObjectNames checks if any immutable objects have changed by comparing the new definition with the current state of the cluster. If they had, it generates a new name for them by increasing a monotonic number at the end of the name. This process is performed to the provider machine template and the kubeadmconfigtemplate. The kubeadmconfigtemplate is not immutable at the API level but we treat it as such for consistency.

type Workers added in v0.12.0

type Workers[M Object[M]] struct {
	Groups []WorkerGroup[M]
}

Workers represents the provider specific CAPI spec for an eks-a cluster's workers.

func (*Workers[M]) UpdateImmutableObjectNames added in v0.12.0

func (w *Workers[M]) UpdateImmutableObjectNames(
	ctx context.Context,
	client kubernetes.Client,
	machineTemplateRetriever ObjectRetriever[M],
	machineTemplateComparator ObjectComparator[M],
) error

UpdateImmutableObjectNames checks if any immutable objects have changed by comparing the new definition with the current state of the cluster. If they had, it generates a new name for them by increasing a monotonic number at the end of the name.

func (*Workers[M]) WorkerObjects added in v0.13.0

func (w *Workers[M]) WorkerObjects() []kubernetes.Object

WorkerObjects returns a list of API objects for concrete provider-specific collection of worker groups.

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
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