Documentation
¶
Index ¶
- func CreateArgoCDProject(ctx context.Context, argoCDProjectClient project.ProjectServiceClient, ...)
- func CreateKubernetesClient(ctx context.Context, kubeconfigPath string, panicOnKubeconfigBuildFailure bool) (client.Client, error)
- func CreateNamespace(ctx context.Context, namespaceName string, kubeClient 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, kubeClient client.Client, resource client.Object) error
- func GetManagementClusterKubeconfigPath(ctx context.Context) string
- func HelmInstall(ctx context.Context, args *HelmInstallArgs)
- func InstallAndSetupArgoCD(ctx context.Context, clusterDir string, kubeClient client.Client)
- func InstallSealedSecrets(ctx context.Context)
- func IsClusterctlMoveExecuted(ctx context.Context, provisionedClusterClient client.Client) bool
- func MustCreateKubernetesClient(ctx context.Context, kubeconfigPath string) client.Client
- func NewArgoCDClient(ctx context.Context, kubeClient client.Client) apiclient.Client
- func RecreateArgoCDApplicationClient(ctx context.Context, clusterClient client.Client)
- func SaveKubeconfig(ctx context.Context, kubeClient client.Client)
- func SyncAllArgoCDApps(ctx context.Context)
- func SyncArgoCDApp(ctx context.Context, name string, ...)
- func WaitForMainClusterToBeProvisioned(ctx context.Context, kubeClient 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 CreateKubernetesClient ¶
func CreateKubernetesClient(ctx context.Context, kubeconfigPath string, panicOnKubeconfigBuildFailure bool, ) (client.Client, error)
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, kubeClient client.Client, resource client.Object) error
Tries to fetch the given Kubernetes resource using the given Kubernetes cluster client.
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 InstallSealedSecrets ¶
Installs Sealed Secrets in the underlying Kubernetes cluster.
func IsClusterctlMoveExecuted ¶
Returns whether the `clusterctl move` command has already been executed or not.
func MustCreateKubernetesClient ¶
Creates a Kubernetes Go client using the Kubeconfig file present at the given path. Panics on failure.
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 SaveKubeconfig ¶
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 WaitForMainClusterToBeProvisioned ¶
Waits for the main cluster to be provisioned.