Documentation ¶
Index ¶
- func ConstructInClusterKubeconfig(ctx context.Context, restConfig *rest.Config, namespace string) (*clientcmdapi.Config, error)
- func GetActionConfig(ctx context.Context, namespace string, config *rest.Config) (*helmAction.Configuration, error)
- func GetClusterField(ctx context.Context, c ctrlClient.Client, cluster *clusterv1.Cluster, ...) (string, error)
- func GetClusterKubeconfig(ctx context.Context, cluster *clusterv1.Cluster) (string, error)
- func GetCustomResource(ctx context.Context, c ctrlClient.Client, kind string, apiVersion string, ...) (*unstructured.Unstructured, error)
- func GetHelmRelease(ctx context.Context, kubeconfig string, ...) (*release.Release, error)
- func HelmInit(ctx context.Context, namespace string, kubeconfig string) (*helmCli.EnvSettings, *helmAction.Configuration, error)
- func InitInClusterKubeconfig(ctx context.Context) (*cluster.Kubeconfig, error)
- func InstallHelmRelease(ctx context.Context, kubeconfig string, ...) (*release.Release, error)
- func InstallOrUpgradeHelmRelease(ctx context.Context, kubeconfig string, ...) (*release.Release, bool, error)
- func ListHelmReleases(ctx context.Context, kubeconfig string, ...) ([]*release.Release, error)
- func ParseValues(ctx context.Context, c ctrlClient.Client, ...) (string, error)
- func RollbackHelmRelease(ctx context.Context, kubeconfig string, ...) error
- func UninstallHelmRelease(ctx context.Context, kubeconfig string, ...) (*release.UninstallReleaseResponse, error)
- func UpgradeHelmReleaseIfChanged(ctx context.Context, kubeconfig string, ...) (*release.Release, bool, error)
- func WriteClusterKubeconfigToFile(ctx context.Context, cluster *clusterv1.Cluster) (string, error)
- func WriteInClusterKubeconfigToFile(ctx context.Context, filePath string, clientConfig clientcmdapi.Config) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructInClusterKubeconfig ¶
func ConstructInClusterKubeconfig(ctx context.Context, restConfig *rest.Config, namespace string) (*clientcmdapi.Config, error)
GetClusterKubeconfig generates a kubeconfig file for the management cluster using a rest.Config. This is a bit of a workaround since the k8s.io/client-go/tools/clientcmd/api expects to be run from a CLI context, but within a pod we don't have that. As a result, we have to manually fill in the fields that would normally be present in ~/.kube/config. This seems to work for now.
func GetActionConfig ¶
func GetActionConfig(ctx context.Context, namespace string, config *rest.Config) (*helmAction.Configuration, error)
GetActionConfig returns a new Helm action configuration.
func GetClusterField ¶
func GetClusterField(ctx context.Context, c ctrlClient.Client, cluster *clusterv1.Cluster, fields []string) (string, error)
GetClusterField returns the value of a field in a selected Cluster.
func GetClusterKubeconfig ¶
GetClusterKubeconfig returns the kubeconfig for a selected Cluster as a string.
func GetCustomResource ¶
func GetCustomResource(ctx context.Context, c ctrlClient.Client, kind string, apiVersion string, namespace string, name string) (*unstructured.Unstructured, error)
GetCustomResource returns the unstructured object for a selected Custom Resource.
func GetHelmRelease ¶
func GetHelmRelease(ctx context.Context, kubeconfig string, spec addonsv1alpha1.HelmReleaseProxySpec) (*release.Release, error)
GetHelmRelease returns a Helm release if it exists.
func HelmInit ¶
func HelmInit(ctx context.Context, namespace string, kubeconfig string) (*helmCli.EnvSettings, *helmAction.Configuration, error)
HelmInit initializes Helm.
func InitInClusterKubeconfig ¶
func InitInClusterKubeconfig(ctx context.Context) (*cluster.Kubeconfig, error)
InitInClusterKubeconfig generates a kubeconfig file for the management cluster. Note: The k8s.io/client-go/tools/clientcmd/api package and associated tools require a path to a kubeconfig file rather than the data stored in an object.
func InstallHelmRelease ¶
func InstallHelmRelease(ctx context.Context, kubeconfig string, spec addonsv1alpha1.HelmReleaseProxySpec) (*release.Release, error)
InstallHelmRelease installs a Helm release.
func InstallOrUpgradeHelmRelease ¶
func InstallOrUpgradeHelmRelease(ctx context.Context, kubeconfig string, spec addonsv1alpha1.HelmReleaseProxySpec) (*release.Release, bool, error)
InstallOrUpgradeHelmRelease installs a Helm release if it does not exist, or upgrades it if it does and differs from the spec. It returns a boolean indicating whether an install or upgrade was performed.
func ListHelmReleases ¶
func ListHelmReleases(ctx context.Context, kubeconfig string, spec addonsv1alpha1.HelmReleaseProxySpec) ([]*release.Release, error)
ListHelmReleases lists all Helm releases in a namespace.
func ParseValues ¶
func ParseValues(ctx context.Context, c ctrlClient.Client, spec addonsv1alpha1.HelmChartProxySpec, cluster *clusterv1.Cluster) (string, error)
ParseValues parses the values template and returns the expanded template. It attempts to populate a map of supported templating objects.
func RollbackHelmRelease ¶
func RollbackHelmRelease(ctx context.Context, kubeconfig string, spec addonsv1alpha1.HelmReleaseProxySpec) error
RollbackHelmRelease rolls back a Helm release.
func UninstallHelmRelease ¶
func UninstallHelmRelease(ctx context.Context, kubeconfig string, spec addonsv1alpha1.HelmReleaseProxySpec) (*release.UninstallReleaseResponse, error)
UninstallHelmRelease uninstalls a Helm release.
func UpgradeHelmReleaseIfChanged ¶
func UpgradeHelmReleaseIfChanged(ctx context.Context, kubeconfig string, spec addonsv1alpha1.HelmReleaseProxySpec, existing *release.Release) (*release.Release, bool, error)
UpgradeHelmReleaseIfChanged upgrades a Helm release.
func WriteClusterKubeconfigToFile ¶
WriteClusterKubeconfigToFile writes the kubeconfig for a selected Cluster to a file.
func WriteInClusterKubeconfigToFile ¶
func WriteInClusterKubeconfigToFile(ctx context.Context, filePath string, clientConfig clientcmdapi.Config) error
WriteInClusterKubeconfigToFile writes the clientcmdapi.Config to a kubeconfig file.
Types ¶
This section is empty.