Documentation ¶
Index ¶
- Constants
- func CapiChangeDiff(currentSpec, newSpec *cluster.Spec, provider providers.Provider) *types.ChangeDiff
- func Cluster(clusterSpec *cluster.Spec, infrastructureObject, controlPlaneObject APIObject) *clusterv1.Cluster
- func ClusterName(cluster *anywherev1.Cluster) string
- func ControlPlaneMachineHealthCheckName(clusterSpec *cluster.Spec) string
- func ControlPlaneMachineTemplateName(clusterSpec *cluster.Spec) string
- func CreateContainerdConfigFileInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster v1alpha1.ClusterSpec)
- func CreateContainerdConfigFileInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster v1alpha1.ClusterSpec)
- func DefaultKubeadmConfigTemplateName(clusterSpec *cluster.Spec, ...) string
- func DefaultObjectName(baseName string) string
- func GetProviders(ctx context.Context, client KubeLister) ([]clusterctlv1.Provider, error)
- func IncrementName(name string) (string, error)
- func IncrementNameWithFallbackDefault(name, defaultName string) string
- func InfrastructureAPIVersion() string
- func KubeadmConfigTemplate(clusterSpec *cluster.Spec, ...) (*bootstrapv1.KubeadmConfigTemplate, error)
- func KubeadmConfigTemplateInCluster(ctx context.Context, kubeclient KubeClient, md *clusterv1.MachineDeployment) (*bootstrapv1.KubeadmConfigTemplate, error)
- func KubeadmControlPlane(clusterSpec *cluster.Spec, infrastructureObject APIObject) (*controlplanev1.KubeadmControlPlane, error)
- func KubeadmControlPlaneName(clusterSpec *cluster.Spec) string
- func MachineDeployment(clusterSpec *cluster.Spec, ...) clusterv1.MachineDeployment
- func MachineDeploymentInCluster(ctx context.Context, kubeclient KubeClient, clusterSpec *cluster.Spec, ...) (*clusterv1.MachineDeployment, error)
- func MachineDeploymentName(clusterSpec *cluster.Spec, ...) string
- func MachineHealthCheckForControlPlane(clusterSpec *cluster.Spec) *clusterv1.MachineHealthCheck
- func MachineHealthCheckForWorkers(clusterSpec *cluster.Spec) []*clusterv1.MachineHealthCheck
- func MachineHealthCheckObjects(clusterSpec *cluster.Spec) []runtime.Object
- func NoProxyDefaults() []string
- func ObjectName(baseName string, version int) string
- func RestartContainerdInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster v1alpha1.ClusterSpec)
- func RestartContainerdInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster v1alpha1.ClusterSpec)
- func SetIdentityAuthInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, clusterSpec *cluster.Spec)
- func SetProxyConfigInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster v1alpha1.ClusterSpec) error
- func SetProxyConfigInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster v1alpha1.ClusterSpec) error
- func SetRegistryMirrorInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, ...) error
- func SetRegistryMirrorInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, ...) error
- func WorkerMachineHealthCheckName(clusterSpec *cluster.Spec, ...) string
- func WorkerMachineTemplateName(clusterSpec *cluster.Spec, ...) string
- type APIObject
- type CAPIChangeDiff
- type CAPIClient
- type Client
- type ClusterResourceSet
- type ExtraArgs
- func AwsIamAuthExtraArgs(awsiam *v1alpha1.AWSIamConfig) ExtraArgs
- func ControlPlaneNodeLabelsExtraArgs(cpc v1alpha1.ControlPlaneConfiguration) ExtraArgs
- func ControllerManagerArgs(clusterSpec *cluster.Spec) ExtraArgs
- func FeatureGatesExtraArgs(features ...string) ExtraArgs
- func NodeCIDRMaskExtraArgs(clusterNetwork *v1alpha1.ClusterNetwork) ExtraArgs
- func OIDCToExtraArgs(oidc *v1alpha1.OIDCConfig) ExtraArgs
- func PodIAMAuthExtraArgs(podIAMConfig *v1alpha1.PodIAMConfig) ExtraArgs
- func ResolvConfExtraArgs(resolvConf *v1alpha1.ResolvConf) ExtraArgs
- func SecureEtcdTlsCipherSuitesExtraArgs() ExtraArgs
- func SecureTlsCipherSuitesExtraArgs() ExtraArgs
- func WorkerNodeLabelsExtraArgs(wnc v1alpha1.WorkerNodeGroupConfiguration) ExtraArgs
- type Installer
- type KubeClient
- type KubeLister
- type KubectlClient
- type Manager
- type ResourceSetManager
- type Upgrader
Constants ¶
const ( EKSAClusterLabelName = "cluster.anywhere.eks.amazonaws.com/cluster-name" EKSAClusterLabelNamespace = "cluster.anywhere.eks.amazonaws.com/cluster-namespace" )
Variables ¶
This section is empty.
Functions ¶
func CapiChangeDiff ¶ added in v0.7.0
func ClusterName ¶ added in v0.9.2
func ClusterName(cluster *anywherev1.Cluster) string
ClusterName generates the CAPI cluster name for an EKSA Cluster
func ControlPlaneMachineHealthCheckName ¶ added in v0.11.0
func ControlPlaneMachineTemplateName ¶ added in v0.9.2
func CreateContainerdConfigFileInKubeadmConfigTemplate ¶ added in v0.9.2
func CreateContainerdConfigFileInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster v1alpha1.ClusterSpec)
func CreateContainerdConfigFileInKubeadmControlPlane ¶ added in v0.9.2
func CreateContainerdConfigFileInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster v1alpha1.ClusterSpec)
func DefaultKubeadmConfigTemplateName ¶ added in v0.9.2
func DefaultKubeadmConfigTemplateName(clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string
func DefaultObjectName ¶ added in v0.9.0
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
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
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 KubeadmConfigTemplate ¶ added in v0.8.0
func KubeadmConfigTemplate(clusterSpec *cluster.Spec, workerNodeGroupConfig anywherev1.WorkerNodeGroupConfiguration) (*bootstrapv1.KubeadmConfigTemplate, error)
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 MachineDeployment ¶ added in v0.8.0
func MachineDeployment(clusterSpec *cluster.Spec, workerNodeGroupConfig anywherev1.WorkerNodeGroupConfiguration, bootstrapObject, infrastructureObject APIObject) clusterv1.MachineDeployment
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(clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string
func MachineHealthCheckForControlPlane ¶ added in v0.11.0
func MachineHealthCheckForControlPlane(clusterSpec *cluster.Spec) *clusterv1.MachineHealthCheck
func MachineHealthCheckForWorkers ¶ added in v0.11.0
func MachineHealthCheckForWorkers(clusterSpec *cluster.Spec) []*clusterv1.MachineHealthCheck
func MachineHealthCheckObjects ¶ added in v0.11.0
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 RestartContainerdInKubeadmConfigTemplate ¶ added in v0.9.2
func RestartContainerdInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster v1alpha1.ClusterSpec)
func RestartContainerdInKubeadmControlPlane ¶ added in v0.9.2
func RestartContainerdInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster v1alpha1.ClusterSpec)
func SetIdentityAuthInKubeadmControlPlane ¶ added in v0.9.0
func SetIdentityAuthInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, clusterSpec *cluster.Spec)
func SetProxyConfigInKubeadmConfigTemplate ¶ added in v0.9.2
func SetProxyConfigInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, cluster v1alpha1.ClusterSpec) error
func SetProxyConfigInKubeadmControlPlane ¶ added in v0.9.2
func SetProxyConfigInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, cluster v1alpha1.ClusterSpec) error
func SetRegistryMirrorInKubeadmConfigTemplate ¶ added in v0.9.0
func SetRegistryMirrorInKubeadmConfigTemplate(kct *bootstrapv1.KubeadmConfigTemplate, mirrorConfig *v1alpha1.RegistryMirrorConfiguration) error
func SetRegistryMirrorInKubeadmControlPlane ¶ added in v0.9.0
func SetRegistryMirrorInKubeadmControlPlane(kcp *controlplanev1.KubeadmControlPlane, mirrorConfig *v1alpha1.RegistryMirrorConfiguration) error
func WorkerMachineHealthCheckName ¶ added in v0.11.0
func WorkerMachineHealthCheckName(clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string
func WorkerMachineTemplateName ¶ added in v0.9.2
func WorkerMachineTemplateName(clusterSpec *cluster.Spec, workerNodeGroupConfig v1alpha1.WorkerNodeGroupConfiguration) string
Types ¶
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 Client ¶ added in v0.6.0
type Client interface { GetClusterResourceSet(ctx context.Context, kubeconfigFile, name, namespace string) (*addons.ClusterResourceSet, error) GetConfigMap(ctx context.Context, kubeconfigFile, name, namespace string) (*corev1.ConfigMap, error) GetSecretFromNamespace(ctx context.Context, kubeconfigFile, name, namespace string) (*corev1.Secret, error) ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) 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 ExtraArgs ¶
func AwsIamAuthExtraArgs ¶ added in v0.6.0
func AwsIamAuthExtraArgs(awsiam *v1alpha1.AWSIamConfig) ExtraArgs
func ControlPlaneNodeLabelsExtraArgs ¶ added in v0.7.0
func ControlPlaneNodeLabelsExtraArgs(cpc v1alpha1.ControlPlaneConfiguration) ExtraArgs
func ControllerManagerArgs ¶ added in v0.9.2
func FeatureGatesExtraArgs ¶ added in v0.11.0
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 (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
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 Manager ¶ added in v0.6.0
func NewManager ¶ added in v0.6.0
func NewManager(capiClient CAPIClient, kubectlClient KubectlClient) *Manager
type ResourceSetManager ¶ added in v0.6.0
type ResourceSetManager struct {
// contains filtered or unexported fields
}
ResourceSetManager helps managing capi ClusterResourceSet's It doesn't implement the complete ClusterResourceSet specification so there might be some configurations that are not supported. JsonLists as content in resources are not supported
func NewResourceSetManager ¶ added in v0.6.0
func NewResourceSetManager(client Client) *ResourceSetManager
func (*ResourceSetManager) ForceUpdate ¶ added in v0.6.0
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