Documentation
¶
Index ¶
- func CreateArgoCDProject(ctx context.Context, argoCDProjectClient project.ProjectServiceClient, ...)
- func CreateBackup(ctx context.Context, name string, clusterClient client.Client)
- func CreateKubernetesClient(ctx context.Context, kubeconfigPath string) (client.Client, error)
- func CreateNamespace(ctx context.Context, namespaceName string, clusterClient client.Client)
- func GenerateSealedSecret(ctx context.Context, secretFilePath string)
- func GetCapiClusterNamespace() string
- func GetClusterResource(ctx context.Context, clusterClient client.Client) (*clusterAPIV1Beta1.Cluster, error)
- func GetKubernetesResource(ctx context.Context, clusterClient client.Client, resource client.Object) error
- func GetLatestVeleroBackup(ctx context.Context, clusterClient client.Client) *veleroV1.Backup
- func GetMainClusterEndpoint(ctx context.Context) *clusterAPIV1Beta1.APIEndpoint
- func GetManagementClusterKubeconfigPath(ctx context.Context) string
- func HelmInstall(ctx context.Context, args *HelmInstallArgs)
- func InstallAndSetupArgoCD(ctx context.Context, clusterDir string, clusterClient client.Client)
- func InstallAndSetupCrossplane(ctx context.Context)
- func InstallSealedSecrets(ctx context.Context)
- func IsClusterctlMoveExecuted(ctx context.Context) bool
- func IsNodeGroupCountZero(ctx context.Context) bool
- func MustCreateClusterClient(ctx context.Context, kubeconfigPath string) client.Client
- func NewArgoCDClient(ctx context.Context, clusterClient client.Client) apiclient.Client
- func RecreateArgoCDApplicationClient(ctx context.Context, clusterClient client.Client)
- func RemoveNoScheduleTaintsFromMasterNodes(ctx context.Context, clusterClient client.Client)
- func RestoreVeleroBackup(ctx context.Context, clusterClient client.Client, ...)
- func SaveProvisionedClusterKubeconfig(ctx context.Context, kubeClient client.Client)
- func SyncAllArgoCDApps(ctx context.Context)
- func SyncArgoCDApp(ctx context.Context, name string, ...)
- func TriggerCRONJob(ctx context.Context, objectKey client.ObjectKey, clusterClient client.Client)
- func UsingClusterAPI() (usingClusterAPI bool)
- func WaitForMainClusterToBeProvisioned(ctx context.Context, managementClusterClient client.Client)
- func WaitForMainClusterToBeReady(ctx context.Context, kubeClient client.Client)
- type HelmInstallArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateArgoCDProject ¶
func CreateArgoCDProject(ctx context.Context, argoCDProjectClient project.ProjectServiceClient, name string, )
Tries to create an ArgoCD Project with the given name. Skips if the ArgoCD Project already exists. Panics on failure.
func CreateBackup ¶ added in v0.11.1
Creates a Velero Backup with the given name.
func CreateKubernetesClient ¶
Tries to create a Kubernetes Go client using the Kubeconfig file present at the given path. Returns the Kubernetes Go client.
func CreateNamespace ¶
Creates the given namespace (if it doesn't already exist).
func GenerateSealedSecret ¶
Takes the path to a Kubernetes Secret file. It replaces the contents of that file by generating the corresponding Sealed Secret.
func GetCapiClusterNamespace ¶
func GetCapiClusterNamespace() string
Returns the namespace (capi-cluster / capi-cluster-<customer-id>) where the 'cloud-credentials' Kubernetes Secret will exist. This Kubernetes Secret will be used by Cluster API to communicate with the underlying cloud provider.
func GetClusterResource ¶
func GetClusterResource(ctx context.Context, clusterClient client.Client, ) (*clusterAPIV1Beta1.Cluster, error)
Looks for and returns the Cluster resource in the given Kubernetes cluster.
func GetKubernetesResource ¶
func GetKubernetesResource(ctx context.Context, clusterClient client.Client, resource client.Object, ) error
Tries to fetch the given Kubernetes resource using the given Kubernetes cluster client.
func GetLatestVeleroBackup ¶ added in v0.10.0
Identifies and returns the latest / most recent Velero Backup.
func GetMainClusterEndpoint ¶ added in v0.10.0
func GetMainClusterEndpoint(ctx context.Context) *clusterAPIV1Beta1.APIEndpoint
Returns API endpoint of the main cluster, if provisioned. Otherwise returns nil.
func GetManagementClusterKubeconfigPath ¶
Returns the management cluster kubeconfig file path, based on whether the script is running inside a container or not.
func HelmInstall ¶
func HelmInstall(ctx context.Context, args *HelmInstallArgs)
Installs the Helm chart (if not already deployed), present at the given local path. We clone the KubeAid repository locally and then use absolute path to one of it's Helm chart (like argo-cd / sealed-secrets), to install that corresponding Helm chart.
func InstallAndSetupArgoCD ¶
Installs the ArgoCD Helm chart and creates the root ArgoCD App. Then creates and returns an ArgoCD Application client.
func InstallAndSetupCrossplane ¶ added in v0.12.2
Installs and sets up CrossPlane.
Syncs the crossplane, crossplane-providers-and-functions and crossplane-compositions ArgoCD Apps one by one. NOTE : We need to sync crossplane deployment itself, then the crossplane providers and functions, and finally the crossplane compositions. I tried packaging everything in a single Helm chart, and using ArgoCD sync waves. But, that didn't work. I'll retry later,
func InstallSealedSecrets ¶
Performs a minimal installation of Sealed Secrets in the underlying Kubernetes cluster.
func IsClusterctlMoveExecuted ¶
Returns whether the 'clusterctl move' command has already been executed or not.
func IsNodeGroupCountZero ¶ added in v0.12.0
Returns whether there are zero node-groups or not. If yes, then we need to remove taints from the control-plane nodes right after the main cluster is provisioned.
func MustCreateClusterClient ¶ added in v0.11.1
Creates a Kubernetes Go client using the Kubeconfig file present at the given path.
func NewArgoCDClient ¶
Port-forwards the ArgoCD server and creates an ArgoCD client. Returns the ArgoCD client.
func RecreateArgoCDApplicationClient ¶
Recreates the ArgoCD Application client by port-forwarding the ArgoCD server. If the clusterClient is not provided (is nil), then it picks up the KUBECONFIG envionment variable and constructs the cluster client by itself.
func RemoveNoScheduleTaintsFromMasterNodes ¶ added in v0.12.0
Removes the 'node-role.kubernetes.io/control-plane:NoSchedule' taint from master nodes.
func RestoreVeleroBackup ¶ added in v0.10.0
func RestoreVeleroBackup(ctx context.Context, clusterClient client.Client, latestVeleroBackup *veleroV1.Backup, )
Creates a Velero Restore object for the given Velero Backup.
func SaveProvisionedClusterKubeconfig ¶ added in v0.8.0
Saves kubeconfig of the provisioned cluster locally.
func SyncAllArgoCDApps ¶
Lists and syncs all the ArgoCD Apps.
func SyncArgoCDApp ¶
func SyncArgoCDApp( ctx context.Context, name string, resources []*argoCDV1Aplha1.SyncOperationResource, )
Syncs the ArgoCD App (if not synced already). If the resources array is empty, then the whole ArgoCD App is synced. Otherwise, only the specified resources.
func TriggerCRONJob ¶ added in v0.11.1
Triggers the given CRONJob, by creating a Job from its Job template.
func UsingClusterAPI ¶ added in v0.12.0
func UsingClusterAPI() (usingClusterAPI bool)
Returns whether we're using Clusterapi or not.
func WaitForMainClusterToBeProvisioned ¶
Waits for the main cluster to be provisioned.