Documentation ¶
Index ¶
- Constants
- func DefaultRetrier() *retrier.Retrier
- func EksaChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ChangeDiff
- type Applier
- type ApplierOpt
- func WithApplierApplyClusterTimeout(timeout time.Duration) ApplierOpt
- func WithApplierNoTimeouts() ApplierOpt
- func WithApplierRetryBackOff(backOff time.Duration) ApplierOpt
- func WithApplierWaitForClusterReconcile(timeout time.Duration) ApplierOpt
- func WithApplierWaitForFailureMessage(timeout time.Duration) ApplierOpt
- type AwsIamAuth
- type ClientFactory
- type ClusterClient
- type ClusterManager
- func (c *ClusterManager) ApplyBundles(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster) error
- func (c *ClusterManager) ApplyReleases(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster) error
- func (c *ClusterManager) BackupCAPI(ctx context.Context, cluster *types.Cluster, ...) error
- func (c *ClusterManager) BackupCAPIWaitForInfrastructure(ctx context.Context, cluster *types.Cluster, ...) error
- func (c *ClusterManager) CreateAwsIamAuthCaSecret(ctx context.Context, managementCluster *types.Cluster, ...) error
- func (c *ClusterManager) CreateEKSANamespace(ctx context.Context, cluster *types.Cluster) error
- func (c *ClusterManager) CreateEKSAResources(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, ...) error
- func (c *ClusterManager) CreateWorkloadCluster(ctx context.Context, managementCluster *types.Cluster, ...) (*types.Cluster, error)
- func (c *ClusterManager) DeleteCluster(ctx context.Context, managementCluster, clusterToDelete *types.Cluster, ...) error
- func (c *ClusterManager) DeletePackageResources(ctx context.Context, managementCluster *types.Cluster, clusterName string) error
- func (c *ClusterManager) EKSAClusterSpecChanged(ctx context.Context, clus *types.Cluster, newClusterSpec *cluster.Spec) (bool, error)
- func (c *ClusterManager) GetCurrentClusterSpec(ctx context.Context, clus *types.Cluster, clusterName string) (*cluster.Spec, error)
- func (c *ClusterManager) InstallAwsIamAuth(ctx context.Context, management, workload *types.Cluster, spec *cluster.Spec) error
- func (c *ClusterManager) InstallCAPI(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster, ...) error
- func (c *ClusterManager) InstallCustomComponents(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster, ...) error
- func (c *ClusterManager) InstallMachineHealthChecks(ctx context.Context, clusterSpec *cluster.Spec, workloadCluster *types.Cluster) error
- func (c *ClusterManager) InstallNetworking(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, ...) error
- func (c *ClusterManager) MoveCAPI(ctx context.Context, from, to *types.Cluster, clusterName string, ...) error
- func (c *ClusterManager) PauseCAPIWorkloadClusters(ctx context.Context, managementCluster *types.Cluster) error
- func (c *ClusterManager) PauseEKSAControllerReconcile(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, ...) error
- func (c *ClusterManager) ResumeCAPIWorkloadClusters(ctx context.Context, managementCluster *types.Cluster) error
- func (c *ClusterManager) ResumeEKSAControllerReconcile(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, ...) error
- func (c *ClusterManager) RunPostCreateWorkloadCluster(ctx context.Context, managementCluster, workloadCluster *types.Cluster, ...) error
- func (c *ClusterManager) SaveLogsManagementCluster(ctx context.Context, spec *cluster.Spec, cluster *types.Cluster) error
- func (c *ClusterManager) SaveLogsWorkloadCluster(ctx context.Context, provider providers.Provider, spec *cluster.Spec, ...) error
- func (c *ClusterManager) Upgrade(ctx context.Context, cluster *types.Cluster, ...) (*types.ChangeDiff, error)
- func (c *ClusterManager) UpgradeCluster(ctx context.Context, managementCluster, workloadCluster *types.Cluster, ...) error
- func (c *ClusterManager) UpgradeNetworking(ctx context.Context, cluster *types.Cluster, ...) (*types.ChangeDiff, error)
- type ClusterManagerOpt
- func WithControlPlaneWaitTimeout(timeout time.Duration) ClusterManagerOpt
- func WithExternalEtcdWaitTimeout(timeout time.Duration) ClusterManagerOpt
- func WithMachineBackoff(machineBackoff time.Duration) ClusterManagerOpt
- func WithMachineMaxWait(machineMaxWait time.Duration) ClusterManagerOpt
- func WithMachineMinWait(machineMinWait time.Duration) ClusterManagerOpt
- func WithNoTimeouts() ClusterManagerOpt
- func WithNodeStartupTimeout(timeout time.Duration) ClusterManagerOpt
- func WithRetrier(retrier *retrier.Retrier) ClusterManagerOpt
- func WithUnhealthyMachineTimeout(timeout time.Duration) ClusterManagerOpt
- type CreateClusterShim
- func (s CreateClusterShim) CreateAsync(ctx context.Context, management *types.Cluster) error
- func (s CreateClusterShim) GetName() string
- func (s CreateClusterShim) WaitUntilControlPlaneAvailable(ctx context.Context, management *types.Cluster) error
- func (s CreateClusterShim) WaitUntilReady(ctx context.Context, management *types.Cluster) error
- func (s CreateClusterShim) WriteKubeconfig(ctx context.Context, w io.Writer, management *types.Cluster) error
- type EKSAComponentGenerator
- type EKSAComponents
- type EKSAInstaller
- type EKSAInstallerOpt
- type KubernetesClient
- type Networking
- type RetrierClient
- func (c *RetrierClient) Apply(ctx context.Context, kubeconfigPath string, obj runtime.Object, ...) error
- func (c *RetrierClient) ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) error
- func (c *RetrierClient) ApplyKubeSpecFromBytesForce(ctx context.Context, cluster *types.Cluster, data []byte) error
- func (c *RetrierClient) ApplyKubeSpecFromBytesWithNamespace(ctx context.Context, cluster *types.Cluster, data []byte, namespace string) error
- func (c *RetrierClient) DeleteAWSIamConfig(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
- func (c *RetrierClient) DeleteCluster(ctx context.Context, cluster, clusterToDelete *types.Cluster) error
- func (c *RetrierClient) DeleteEKSACluster(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
- func (c *RetrierClient) DeleteGitOpsConfig(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
- func (c *RetrierClient) DeleteOIDCConfig(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
- func (c *RetrierClient) ListObjects(ctx context.Context, resourceType, namespace, kubeconfig string, ...) error
- func (c *RetrierClient) PauseCAPICluster(ctx context.Context, cluster, kubeconfig string) error
- func (c *RetrierClient) RemoveAnnotationInNamespace(ctx context.Context, resourceType, objectName, key string, ...) error
- func (c *RetrierClient) ResumeCAPICluster(ctx context.Context, cluster, kubeconfig string) error
- func (c *RetrierClient) UpdateAnnotationInNamespace(ctx context.Context, resourceType, objectName string, ...) error
Constants ¶
const ( // DefaultMaxWaitPerMachine is the default max time the cluster manager will wait per a machine. DefaultMaxWaitPerMachine = 10 * time.Minute // DefaultClusterWait is the default max time the cluster manager will wait for the capi cluster to be in ready state. DefaultClusterWait = 60 * time.Minute // DefaultControlPlaneWait is the default time the cluster manager will wait for the control plane to be ready. DefaultControlPlaneWait = 60 * time.Minute // DefaultControlPlaneWaitAfterMove is the default max time the cluster manager will wait for the control plane to be in ready state after the capi move operation. DefaultControlPlaneWaitAfterMove = 15 * time.Minute // DefaultDeploymentWait is the default max time the cluster manager will wait for the deployment to be available. DefaultDeploymentWait = 30 * time.Minute // DefaultEtcdWait is the default time the cluster manager will wait for ectd to be ready. DefaultEtcdWait = 60 * time.Minute // DefaultUnhealthyMachineTimeout is the default timeout for an unhealthy machine health check. DefaultUnhealthyMachineTimeout = 5 * time.Minute // DefaultNodeStartupTimeout is the default timeout for a machine without a node to be considered to have failed machine health check. DefaultNodeStartupTimeout = 10 * time.Minute // DefaultClusterctlMoveTimeout is arbitrarily established. Equal to kubectl wait default timeouts. DefaultClusterctlMoveTimeout = 30 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func DefaultRetrier ¶ added in v0.13.0
DefaultRetrier builds a retrier with the default configuration.
func EksaChangeDiff ¶ added in v0.7.0
func EksaChangeDiff(currentSpec, newSpec *cluster.Spec) *types.ChangeDiff
EksaChangeDiff computes the version diff in eksa components between two specs.
Types ¶
type Applier ¶ added in v0.18.0
type Applier struct {
// contains filtered or unexported fields
}
Applier applies the cluster spec to the management cluster and waits until the changes are fully reconciled.
func NewApplier ¶ added in v0.18.0
func NewApplier(log logr.Logger, clientFactory ClientFactory, opts ...ApplierOpt) Applier
NewApplier builds an Applier.
type ApplierOpt ¶ added in v0.18.0
type ApplierOpt func(*Applier)
ApplierOpt allows to customize a Applier on construction.
func WithApplierApplyClusterTimeout ¶ added in v0.18.0
func WithApplierApplyClusterTimeout(timeout time.Duration) ApplierOpt
WithApplierApplyClusterTimeout allows to configure how long the applier retries to apply the objects in case of failure. Generally only used in tests.
func WithApplierNoTimeouts ¶ added in v0.18.0
func WithApplierNoTimeouts() ApplierOpt
WithApplierNoTimeouts disables the timeout for all the waits and retries in management upgrader.
func WithApplierRetryBackOff ¶ added in v0.18.0
func WithApplierRetryBackOff(backOff time.Duration) ApplierOpt
WithApplierRetryBackOff allows to configure how long the applier waits between requests to update the cluster spec objects and check the status of the Cluster. Generally only used in tests.
func WithApplierWaitForClusterReconcile ¶ added in v0.18.0
func WithApplierWaitForClusterReconcile(timeout time.Duration) ApplierOpt
WithApplierWaitForClusterReconcile allows to configure how long the applier waits for the cluster to reach the Ready state after applying changes. Generally only used in tests.
func WithApplierWaitForFailureMessage ¶ added in v0.18.0
func WithApplierWaitForFailureMessage(timeout time.Duration) ApplierOpt
WithApplierWaitForFailureMessage allows to configure how long the applier waits for failure message to be empty and check the status of the Cluster. Generally only used in tests.
type AwsIamAuth ¶ added in v0.6.0
type AwsIamAuth interface { CreateAndInstallAWSIAMAuthCASecret(ctx context.Context, managementCluster *types.Cluster, workloadClusterName string) error InstallAWSIAMAuth(ctx context.Context, management, workload *types.Cluster, spec *cluster.Spec) error UpgradeAWSIAMAuth(ctx context.Context, cluster *types.Cluster, spec *cluster.Spec) error }
type ClientFactory ¶ added in v0.15.0
type ClientFactory interface { // BuildClientFromKubeconfig builds a Kubernetes client from a kubeconfig file. BuildClientFromKubeconfig(kubeconfigPath string) (kubernetes.Client, error) }
ClientFactory builds Kubernetes clients.
type ClusterClient ¶
type ClusterClient interface { KubernetesClient BackupManagement(ctx context.Context, cluster *types.Cluster, managementStatePath, clusterName string) error MoveManagement(ctx context.Context, from, target *types.Cluster, clusterName string) error WaitForClusterReady(ctx context.Context, cluster *types.Cluster, timeout string, clusterName string) error WaitForControlPlaneAvailable(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName string) error WaitForControlPlaneReady(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName string) error WaitForControlPlaneNotReady(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName string) error WaitForManagedExternalEtcdReady(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName string) error WaitForManagedExternalEtcdNotReady(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName string) error GetWorkloadKubeconfig(ctx context.Context, clusterName string, cluster *types.Cluster) ([]byte, error) GetEksaGitOpsConfig(ctx context.Context, gitOpsConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.GitOpsConfig, error) GetEksaFluxConfig(ctx context.Context, fluxConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.FluxConfig, error) GetEksaOIDCConfig(ctx context.Context, oidcConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.OIDCConfig, error) GetEksaAWSIamConfig(ctx context.Context, awsIamConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.AWSIamConfig, error) DeleteCluster(ctx context.Context, managementCluster, clusterToDelete *types.Cluster) error DeleteGitOpsConfig(ctx context.Context, managementCluster *types.Cluster, gitOpsName, namespace string) error DeleteOIDCConfig(ctx context.Context, managementCluster *types.Cluster, oidcConfigName, oidcConfigNamespace string) error DeleteAWSIamConfig(ctx context.Context, managementCluster *types.Cluster, awsIamConfigName, awsIamConfigNamespace string) error DeleteEKSACluster(ctx context.Context, managementCluster *types.Cluster, eksaClusterName, eksaClusterNamespace string) error DeletePackageResources(ctx context.Context, managementCluster *types.Cluster, clusterName string) error InitInfrastructure(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster, provider providers.Provider) error WaitForDeployment(ctx context.Context, cluster *types.Cluster, timeout string, condition string, target string, namespace string) error SaveLog(ctx context.Context, cluster *types.Cluster, deployment *types.Deployment, fileName string, writer filewriter.FileWriter) error GetMachines(ctx context.Context, cluster *types.Cluster, clusterName string) ([]types.Machine, error) GetClusters(ctx context.Context, cluster *types.Cluster) ([]types.CAPICluster, error) PauseCAPICluster(ctx context.Context, cluster, kubeconfig string) error ResumeCAPICluster(ctx context.Context, cluster, kubeconfig string) error GetEksaCluster(ctx context.Context, cluster *types.Cluster, clusterName string) (*v1alpha1.Cluster, error) GetEksaVSphereDatacenterConfig(ctx context.Context, VSphereDatacenterName string, kubeconfigFile string, namespace string) (*v1alpha1.VSphereDatacenterConfig, error) UpdateEnvironmentVariablesInNamespace(ctx context.Context, resourceType, resourceName string, envMap map[string]string, cluster *types.Cluster, namespace string) error GetEksaVSphereMachineConfig(ctx context.Context, VSphereDatacenterName string, kubeconfigFile string, namespace string) (*v1alpha1.VSphereMachineConfig, error) GetEksaCloudStackMachineConfig(ctx context.Context, cloudstackMachineConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.CloudStackMachineConfig, error) SetEksaControllerEnvVar(ctx context.Context, envVar, envVarVal, kubeconfig string) error CreateNamespaceIfNotPresent(ctx context.Context, kubeconfig string, namespace string) error ValidateControlPlaneNodes(ctx context.Context, cluster *types.Cluster, clusterName string) error ValidateWorkerNodes(ctx context.Context, clusterName string, kubeconfigFile string) error CountMachineDeploymentReplicasReady(ctx context.Context, clusterName string, kubeconfigFile string) (int, int, error) GetBundles(ctx context.Context, kubeconfigFile, name, namespace string) (*releasev1alpha1.Bundles, error) GetApiServerUrl(ctx context.Context, cluster *types.Cluster) (string, error) KubeconfigSecretAvailable(ctx context.Context, kubeconfig string, clusterName string, namespace string) (bool, error) DeleteOldWorkerNodeGroup(ctx context.Context, machineDeployment *clusterv1.MachineDeployment, kubeconfig string) error GetKubeadmControlPlane(ctx context.Context, cluster *types.Cluster, clusterName string, opts ...executables.KubectlOpt) (*controlplanev1.KubeadmControlPlane, error) GetMachineDeploymentsForCluster(ctx context.Context, clusterName string, opts ...executables.KubectlOpt) ([]clusterv1.MachineDeployment, error) GetMachineDeployment(ctx context.Context, workerNodeGroupName string, opts ...executables.KubectlOpt) (*clusterv1.MachineDeployment, error) GetEksdRelease(ctx context.Context, name, namespace, kubeconfigFile string) (*eksdv1alpha1.Release, error) ListObjects(ctx context.Context, resourceType, namespace, kubeconfig string, list kubernetes.ObjectList) error }
type ClusterManager ¶
type ClusterManager struct { ClientFactory ClientFactory // contains filtered or unexported fields }
func New ¶
func New(client ClientFactory, clusterClient *RetrierClient, networking Networking, writer filewriter.FileWriter, diagnosticBundleFactory diagnostics.DiagnosticBundleFactory, awsIamAuth AwsIamAuth, eksaComponents EKSAComponents, opts ...ClusterManagerOpt) *ClusterManager
New constructs a new ClusterManager.
func (*ClusterManager) ApplyBundles ¶ added in v0.6.0
func (*ClusterManager) ApplyReleases ¶ added in v0.17.0
func (c *ClusterManager) ApplyReleases(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster) error
ApplyReleases applies the EKSARelease manifest.
func (*ClusterManager) BackupCAPI ¶ added in v0.14.4
func (c *ClusterManager) BackupCAPI(ctx context.Context, cluster *types.Cluster, managementStatePath, clusterName string) error
BackupCAPI takes backup of management cluster's resources during the upgrade process.
func (*ClusterManager) BackupCAPIWaitForInfrastructure ¶ added in v0.16.3
func (c *ClusterManager) BackupCAPIWaitForInfrastructure(ctx context.Context, cluster *types.Cluster, managementStatePath, clusterName string) error
BackupCAPIWaitForInfrastructure takes backup of bootstrap cluster's resources during the upgrade process like BackupCAPI but with a retry policy to wait for infrastructure provisioning in addition to network errors.
func (*ClusterManager) CreateAwsIamAuthCaSecret ¶ added in v0.6.0
func (*ClusterManager) CreateEKSANamespace ¶ added in v0.11.0
func (*ClusterManager) CreateEKSAResources ¶
func (c *ClusterManager) CreateEKSAResources(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, datacenterConfig providers.DatacenterConfig, machineConfigs []providers.MachineConfig, ) error
CreateEKSAResources applies the eks-a cluster specs (cluster, datacenterconfig, machine configs, etc.), as well as the release bundle to the cluster. Before applying the spec, we pause eksa controller cluster and datacenter webhook validation so that the cluster spec can be created or updated in the cluster without webhook validation error.
func (*ClusterManager) CreateWorkloadCluster ¶
func (c *ClusterManager) CreateWorkloadCluster(ctx context.Context, managementCluster *types.Cluster, clusterSpec *cluster.Spec, provider providers.Provider) (*types.Cluster, error)
CreateWorkloadCluster creates a workload cluster in the provider that the customer has specified. It applied the kubernetes manifest file on the management cluster, waits for the control plane to be ready, and then generates the kubeconfig for the cluster. It returns a struct of type Cluster containing the name and the kubeconfig of the cluster.
func (*ClusterManager) DeleteCluster ¶
func (*ClusterManager) DeletePackageResources ¶ added in v0.12.0
func (*ClusterManager) EKSAClusterSpecChanged ¶
func (c *ClusterManager) EKSAClusterSpecChanged(ctx context.Context, clus *types.Cluster, newClusterSpec *cluster.Spec) (bool, error)
EKSAClusterSpecChanged checks if a cluster's new Spec is different from the current Spec.
func (*ClusterManager) GetCurrentClusterSpec ¶ added in v0.6.0
func (*ClusterManager) InstallAwsIamAuth ¶ added in v0.6.0
func (c *ClusterManager) InstallAwsIamAuth(ctx context.Context, management, workload *types.Cluster, spec *cluster.Spec) error
InstallAwsIamAuth applies the aws-iam-authenticator manifest based on cluster spec inputs. Generates a kubeconfig for interacting with the cluster with aws-iam-authenticator client.
func (*ClusterManager) InstallCAPI ¶ added in v0.6.0
func (*ClusterManager) InstallCustomComponents ¶
func (*ClusterManager) InstallMachineHealthChecks ¶
func (c *ClusterManager) InstallMachineHealthChecks(ctx context.Context, clusterSpec *cluster.Spec, workloadCluster *types.Cluster) error
InstallMachineHealthChecks installs machine health checks for a given eksa cluster.
func (*ClusterManager) InstallNetworking ¶
func (*ClusterManager) PauseCAPIWorkloadClusters ¶ added in v0.16.0
func (c *ClusterManager) PauseCAPIWorkloadClusters(ctx context.Context, managementCluster *types.Cluster) error
PauseCAPIWorkloadClusters pauses all workload CAPI clusters except the management cluster.
func (*ClusterManager) PauseEKSAControllerReconcile ¶
func (*ClusterManager) ResumeCAPIWorkloadClusters ¶ added in v0.16.0
func (c *ClusterManager) ResumeCAPIWorkloadClusters(ctx context.Context, managementCluster *types.Cluster) error
ResumeCAPIWorkloadClusters resumes all workload CAPI clusters except the management cluster.
func (*ClusterManager) ResumeEKSAControllerReconcile ¶
func (*ClusterManager) RunPostCreateWorkloadCluster ¶ added in v0.10.1
func (*ClusterManager) SaveLogsManagementCluster ¶ added in v0.6.0
func (*ClusterManager) SaveLogsWorkloadCluster ¶ added in v0.6.0
func (*ClusterManager) Upgrade ¶ added in v0.13.0
func (c *ClusterManager) Upgrade(ctx context.Context, cluster *types.Cluster, currentSpec, newSpec *cluster.Spec) (*types.ChangeDiff, error)
Upgrade updates the eksa components in a cluster according to a Spec.
func (*ClusterManager) UpgradeCluster ¶
func (*ClusterManager) UpgradeNetworking ¶ added in v0.7.0
type ClusterManagerOpt ¶
type ClusterManagerOpt func(*ClusterManager)
func WithControlPlaneWaitTimeout ¶ added in v0.12.0
func WithControlPlaneWaitTimeout(timeout time.Duration) ClusterManagerOpt
func WithExternalEtcdWaitTimeout ¶ added in v0.12.0
func WithExternalEtcdWaitTimeout(timeout time.Duration) ClusterManagerOpt
func WithMachineBackoff ¶ added in v0.12.0
func WithMachineBackoff(machineBackoff time.Duration) ClusterManagerOpt
func WithMachineMaxWait ¶ added in v0.12.0
func WithMachineMaxWait(machineMaxWait time.Duration) ClusterManagerOpt
func WithMachineMinWait ¶ added in v0.12.0
func WithMachineMinWait(machineMinWait time.Duration) ClusterManagerOpt
func WithNoTimeouts ¶ added in v0.14.4
func WithNoTimeouts() ClusterManagerOpt
WithNoTimeouts disables the timeout for all the waits and retries in cluster manager.
func WithNodeStartupTimeout ¶ added in v0.14.1
func WithNodeStartupTimeout(timeout time.Duration) ClusterManagerOpt
WithNodeStartupTimeout sets the timeout of a machine without a node to be considered to have failed machine health check.
func WithRetrier ¶ added in v0.6.0
func WithRetrier(retrier *retrier.Retrier) ClusterManagerOpt
func WithUnhealthyMachineTimeout ¶ added in v0.13.0
func WithUnhealthyMachineTimeout(timeout time.Duration) ClusterManagerOpt
WithUnhealthyMachineTimeout sets the timeout of an unhealthy machine health check.
type CreateClusterShim ¶ added in v0.13.0
type CreateClusterShim struct {
// contains filtered or unexported fields
}
CreateClusterShim is a shim that implements the workload.Cluster interface. It leverages existing ClusterManager behavior to create a cluster for new workflows.
func NewCreateClusterShim ¶ added in v0.13.0
func NewCreateClusterShim( spec *cluster.Spec, manager *ClusterManager, provider providers.Provider, ) *CreateClusterShim
NewCreateClusterShim returns a new CreateClusterShim instance.
func (CreateClusterShim) CreateAsync ¶ added in v0.13.0
CreateAsync satisfies the workload.Cluster interface.
func (CreateClusterShim) GetName ¶ added in v0.13.0
func (s CreateClusterShim) GetName() string
GetName satisfies the workload.Cluster interface.
func (CreateClusterShim) WaitUntilControlPlaneAvailable ¶ added in v0.13.0
func (s CreateClusterShim) WaitUntilControlPlaneAvailable(ctx context.Context, management *types.Cluster) error
WaitUntilControlPlaneAvailable satisfies the workload.Cluster interface.
func (CreateClusterShim) WaitUntilReady ¶ added in v0.13.0
WaitUntilReady satisfies the workload.Cluster interface.
func (CreateClusterShim) WriteKubeconfig ¶ added in v0.13.0
func (s CreateClusterShim) WriteKubeconfig(ctx context.Context, w io.Writer, management *types.Cluster) error
WriteKubeconfig satisfies the workload.Cluster interface.
type EKSAComponentGenerator ¶ added in v0.13.0
type EKSAComponentGenerator struct {
// contains filtered or unexported fields
}
EKSAComponentGenerator generates and configures eks-a components.
type EKSAComponents ¶ added in v0.13.0
type EKSAComponents interface { Install(ctx context.Context, log logr.Logger, cluster *types.Cluster, spec *cluster.Spec) error Upgrade(ctx context.Context, log logr.Logger, cluster *types.Cluster, currentSpec, newSpec *cluster.Spec) (*types.ChangeDiff, error) }
EKSAComponents allows to manage the eks-a components installation in a cluster.
type EKSAInstaller ¶ added in v0.13.0
type EKSAInstaller struct {
// contains filtered or unexported fields
}
EKSAInstaller allows to install eks-a components in a cluster.
func NewEKSAInstaller ¶ added in v0.13.0
func NewEKSAInstaller(client KubernetesClient, reader manifests.FileReader, opts ...EKSAInstallerOpt) *EKSAInstaller
NewEKSAInstaller constructs a new EKSAInstaller.
func (*EKSAInstaller) Install ¶ added in v0.13.0
func (i *EKSAInstaller) Install(ctx context.Context, log logr.Logger, cluster *types.Cluster, spec *cluster.Spec) error
Install configures and applies eks-a components in a cluster accordingly to a spec.
func (*EKSAInstaller) Upgrade ¶ added in v0.13.0
func (i *EKSAInstaller) Upgrade(ctx context.Context, log logr.Logger, c *types.Cluster, currentSpec, newSpec *cluster.Spec) (*types.ChangeDiff, error)
Upgrade re-installs the eksa components in a cluster if the VersionBundle defined in the new spec has a different eks-a components version. Workload clusters are ignored.
type EKSAInstallerOpt ¶ added in v0.14.4
type EKSAInstallerOpt func(*EKSAInstaller)
EKSAInstallerOpt updates an EKSAInstaller.
func WithEKSAInstallerNoTimeouts ¶ added in v0.14.4
func WithEKSAInstallerNoTimeouts() EKSAInstallerOpt
WithEKSAInstallerNoTimeouts disables the timeout when waiting for a deployment to be ready.
type KubernetesClient ¶ added in v0.13.0
type KubernetesClient interface { Apply(ctx context.Context, kubeconfigPath string, obj runtime.Object, opts ...kubernetes.KubectlApplyOption) error ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) error ApplyKubeSpecFromBytesWithNamespace(ctx context.Context, cluster *types.Cluster, data []byte, namespace string) error ApplyKubeSpecFromBytesForce(ctx context.Context, cluster *types.Cluster, data []byte) error WaitForDeployment(ctx context.Context, cluster *types.Cluster, timeout string, condition string, target string, namespace string) error UpdateAnnotationInNamespace(ctx context.Context, resourceType, objectName string, annotations map[string]string, cluster *types.Cluster, namespace string) error RemoveAnnotationInNamespace(ctx context.Context, resourceType, objectName, key string, cluster *types.Cluster, namespace string) error }
KubernetesClient allows to interact with the k8s api server.
type Networking ¶
type Networking interface { Install(ctx context.Context, cluster *types.Cluster, clusterSpec *cluster.Spec, namespaces []string) error Upgrade(ctx context.Context, cluster *types.Cluster, currentSpec, newSpec *cluster.Spec, namespaces []string) (*types.ChangeDiff, error) RunPostControlPlaneUpgradeSetup(ctx context.Context, cluster *types.Cluster) error }
type RetrierClient ¶ added in v0.13.0
type RetrierClient struct {
// contains filtered or unexported fields
}
RetrierClient wraps around a ClusterClient, offering retry functionality for some operations.
func NewRetrierClient ¶ added in v0.6.0
func NewRetrierClient(client ClusterClient, retrier *retrier.Retrier) *RetrierClient
NewRetrierClient constructs a new RetrierClient.
func (*RetrierClient) Apply ¶ added in v0.13.0
func (c *RetrierClient) Apply(ctx context.Context, kubeconfigPath string, obj runtime.Object, opts ...kubernetes.KubectlApplyOption) error
Apply creates/updates an object against the api server following a client side apply mechanism.
func (*RetrierClient) ApplyKubeSpecFromBytes ¶ added in v0.13.0
func (c *RetrierClient) ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) error
ApplyKubeSpecFromBytes creates/updates the objects defined in a yaml manifest against the api server following a client side apply mechanism.
func (*RetrierClient) ApplyKubeSpecFromBytesForce ¶ added in v0.13.0
func (c *RetrierClient) ApplyKubeSpecFromBytesForce(ctx context.Context, cluster *types.Cluster, data []byte) error
ApplyKubeSpecFromBytesForce creates/updates the objects defined in a yaml manifest against the api server following a client side apply mechanism. It forces the operation, so if api validation failed, it will delete and re-create the object.
func (*RetrierClient) ApplyKubeSpecFromBytesWithNamespace ¶ added in v0.13.0
func (c *RetrierClient) ApplyKubeSpecFromBytesWithNamespace(ctx context.Context, cluster *types.Cluster, data []byte, namespace string) error
ApplyKubeSpecFromBytesWithNamespace creates/updates the objects defined in a yaml manifest against the api server following a client side apply mechanism. It applies all objects in the given namespace.
func (*RetrierClient) DeleteAWSIamConfig ¶ added in v0.13.0
func (c *RetrierClient) DeleteAWSIamConfig(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
DeleteAWSIamConfig deletes an AWSIamConfig object from the cluster.
func (*RetrierClient) DeleteCluster ¶ added in v0.13.0
func (c *RetrierClient) DeleteCluster(ctx context.Context, cluster, clusterToDelete *types.Cluster) error
DeleteCluster deletes a CAPI Cluster from the cluster.
func (*RetrierClient) DeleteEKSACluster ¶ added in v0.13.0
func (c *RetrierClient) DeleteEKSACluster(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
DeleteEKSACluster deletes an EKSA Cluster object from the cluster.
func (*RetrierClient) DeleteGitOpsConfig ¶ added in v0.13.0
func (c *RetrierClient) DeleteGitOpsConfig(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
DeleteGitOpsConfig deletes a GitOpsConfigObject from the cluster.
func (*RetrierClient) DeleteOIDCConfig ¶ added in v0.13.0
func (c *RetrierClient) DeleteOIDCConfig(ctx context.Context, cluster *types.Cluster, name string, namespace string) error
DeleteOIDCConfig deletes a OIDCConfig object from the cluster.
func (*RetrierClient) ListObjects ¶ added in v0.13.0
func (c *RetrierClient) ListObjects(ctx context.Context, resourceType, namespace, kubeconfig string, list kubernetes.ObjectList) error
ListObjects reads all Objects of a particular resource type in a namespace.
func (*RetrierClient) PauseCAPICluster ¶ added in v0.16.0
func (c *RetrierClient) PauseCAPICluster(ctx context.Context, cluster, kubeconfig string) error
PauseCAPICluster adds a `spec.Paused: true` to the CAPI cluster resource. This will cause all downstream CAPI + provider controllers to skip reconciling on the paused cluster's objects.
func (*RetrierClient) RemoveAnnotationInNamespace ¶ added in v0.13.0
func (c *RetrierClient) RemoveAnnotationInNamespace(ctx context.Context, resourceType, objectName, key string, cluster *types.Cluster, namespace string) error
RemoveAnnotationInNamespace deletes an annotation for the given kubernetes resource if present.
func (*RetrierClient) ResumeCAPICluster ¶ added in v0.16.0
func (c *RetrierClient) ResumeCAPICluster(ctx context.Context, cluster, kubeconfig string) error
ResumeCAPICluster removes the `spec.Paused` on the CAPI cluster resource. This will cause all downstream CAPI + provider controllers to resume reconciling on the paused cluster's objects.
func (*RetrierClient) UpdateAnnotationInNamespace ¶ added in v0.13.0
func (c *RetrierClient) UpdateAnnotationInNamespace(ctx context.Context, resourceType, objectName string, annotations map[string]string, cluster *types.Cluster, namespace string) error
UpdateAnnotationInNamespace adds/updates an annotation for the given kubernetes resource.