Documentation
¶
Index ¶
- Variables
- func DeleteVerrazzanoFromRemoteCluster(ctx context.Context, c Client, vz *models.Verrazzano, ...) error
- func GetActionConfig(ctx context.Context, namespace string, config *rest.Config) (*helmAction.Configuration, error)
- func GetDefaultVPOImageFromHelmChart() (string, error)
- func GetVerrazzanoFromRemoteCluster(ctx context.Context, c Client, ...) (*models.Verrazzano, error)
- func GetVerrazzanoPlatformOperatorAddons(ctx context.Context, fleetSpec *addonsv1alpha1.VerrazzanoFleetBinding) (*models.HelmModuleAddons, error)
- func HelmInit(ctx context.Context, namespace string, kubeconfig string) (*helmCli.EnvSettings, *helmAction.Configuration, error)
- func ParseDefaultVPOImage(vpoImage string) (registry string, repo string, image string, tag string)
- func PatchVerrazzano(ctx context.Context, client Client, ...) error
- func WaitForVerrazzanoUninstallCompletion(ctx context.Context, c Client, ...) error
- type Client
- type Getter
- type HelmClient
- func (c *HelmClient) GetHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.Release, error)
- func (c *HelmClient) GetWorkloadClusterDynamicK8sClient(ctx context.Context, kubeconfig string) (dynamic.Interface, error)
- func (c *HelmClient) GetWorkloadClusterK8sClient(ctx context.Context, kubeconfig string) (kubernetes.Interface, error)
- func (c *HelmClient) InstallHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons) (*helmRelease.Release, error)
- func (c *HelmClient) InstallOrUpgradeHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, ...) (*helmRelease.Release, error)
- func (c *HelmClient) ListHelmReleases(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) ([]*helmRelease.Release, error)
- func (c *HelmClient) RollbackHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) error
- func (c *HelmClient) UninstallHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.UninstallReleaseResponse, error)
- func (c *HelmClient) UpgradeHelmReleaseIfChanged(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, ...) (*helmRelease.Release, error)
- type KubeconfigGetter
- type VPOHelmValuesTemplate
Constants ¶
This section is empty.
Variables ¶
var (
GetCoreV1Func = k8sutils.GetCoreV1Client
)
var GetterFunc = NewGetter()
Functions ¶
func DeleteVerrazzanoFromRemoteCluster ¶
func DeleteVerrazzanoFromRemoteCluster(ctx context.Context, c Client, vz *models.Verrazzano, fleetBindingName, kubeconfig, clusterName string) error
DeleteVerrazzanoFromRemoteCluster triggers the Verrazzano deletion on the remote cluster.
func GetActionConfig ¶
func GetActionConfig(ctx context.Context, namespace string, config *rest.Config) (*helmAction.Configuration, error)
GetActionConfig returns a new Helm action configuration.
func GetDefaultVPOImageFromHelmChart ¶
GetDefaultVPOImageFromHelmChart returns the default VPO image found in the VPO helm charts value.yaml
func GetVerrazzanoFromRemoteCluster ¶
func GetVerrazzanoFromRemoteCluster(ctx context.Context, c Client, fleetBindingName, kubeconfig, clusterName string) (*models.Verrazzano, error)
GetVerrazzanoFromRemoteCluster fetches the Verrazzano object from a remote cluster.
func GetVerrazzanoPlatformOperatorAddons ¶
func GetVerrazzanoPlatformOperatorAddons(ctx context.Context, fleetSpec *addonsv1alpha1.VerrazzanoFleetBinding) (*models.HelmModuleAddons, error)
GetVerrazzanoPlatformOperatorAddons returns the needed info to install the verrazzano-platform-operator helm chart.
func HelmInit ¶
func HelmInit(ctx context.Context, namespace string, kubeconfig string) (*helmCli.EnvSettings, *helmAction.Configuration, error)
HelmInit initializes Helm.
func ParseDefaultVPOImage ¶
ParseDefaultVPOImage parses the default VPO image and returns the parts of the VPO image
func PatchVerrazzano ¶
func PatchVerrazzano(ctx context.Context, client Client, fleetBindingName, kubeconfig, clusterName string, obj *unstructured.Unstructured) error
PatchVerrazzano helps apply the verrazzano config on the remote cluster
Types ¶
type Client ¶
type Client interface { InstallOrUpgradeHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, verrazzanoFleetBinding *addonsv1alpha1.VerrazzanoFleetBinding) (*helmRelease.Release, error) GetHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.Release, error) UninstallHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.UninstallReleaseResponse, error) GetWorkloadClusterK8sClient(ctx context.Context, kubeconfig string) (kubernetes.Interface, error) GetWorkloadClusterDynamicK8sClient(ctx context.Context, kubeconfig string) (dynamic.Interface, error) }
type HelmClient ¶
type HelmClient struct{}
func (*HelmClient) GetHelmRelease ¶
func (c *HelmClient) GetHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.Release, error)
GetHelmRelease returns a Helm release if it exists.
func (*HelmClient) GetWorkloadClusterDynamicK8sClient ¶
func (c *HelmClient) GetWorkloadClusterDynamicK8sClient(ctx context.Context, kubeconfig string) (dynamic.Interface, error)
GetWorkloadClusterDynamicK8sClient returns the Dynamic K8s client of an OCNE cluster if it exists.
func (*HelmClient) GetWorkloadClusterK8sClient ¶
func (c *HelmClient) GetWorkloadClusterK8sClient(ctx context.Context, kubeconfig string) (kubernetes.Interface, error)
GetWorkloadClusterK8sClient returns the K8s client of an OCNE cluster if it exists.
func (*HelmClient) InstallHelmRelease ¶
func (c *HelmClient) InstallHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons) (*helmRelease.Release, error)
InstallHelmRelease installs a Helm release.
func (*HelmClient) InstallOrUpgradeHelmRelease ¶
func (c *HelmClient) InstallOrUpgradeHelmRelease(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, verrazzanoFleetBinding *addonsv1alpha1.VerrazzanoFleetBinding) (*helmRelease.Release, 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 (*HelmClient) ListHelmReleases ¶
func (c *HelmClient) ListHelmReleases(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) ([]*helmRelease.Release, error)
ListHelmReleases lists all Helm releases in a namespace.
func (*HelmClient) RollbackHelmRelease ¶
func (c *HelmClient) RollbackHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) error
RollbackHelmRelease rolls back a Helm release.
func (*HelmClient) UninstallHelmRelease ¶
func (c *HelmClient) UninstallHelmRelease(ctx context.Context, kubeconfig string, spec *models.HelmModuleAddons) (*helmRelease.UninstallReleaseResponse, error)
UninstallHelmRelease uninstalls a Helm release.
func (*HelmClient) UpgradeHelmReleaseIfChanged ¶
func (c *HelmClient) UpgradeHelmReleaseIfChanged(ctx context.Context, kubeconfig, values string, spec *models.HelmModuleAddons, existing *helmRelease.Release, verrazzanoFleetBinding *addonsv1alpha1.VerrazzanoFleetBinding) (*helmRelease.Release, error)
UpgradeHelmReleaseIfChanged upgrades a Helm release. The boolean refers to if an upgrade was attempted.
type KubeconfigGetter ¶
type KubeconfigGetter struct{}
func NewGetter ¶
func NewGetter() *KubeconfigGetter
func (*KubeconfigGetter) CreateOrUpdateVerrazzano ¶
func (k *KubeconfigGetter) CreateOrUpdateVerrazzano(ctx context.Context, client Client, fleetBindingName, kubeconfig, clusterName string, vzSpecRawExtension *runtime.RawExtension) error
CreateOrUpdateVerrazzano starts verrazzano deployment
func (*KubeconfigGetter) GetClusterKubeconfig ¶
func (k *KubeconfigGetter) GetClusterKubeconfig(ctx context.Context, cluster *clusterv1.Cluster) (string, error)
GetClusterKubeconfig returns the kubeconfig for a selected Cluster as a string.
type VPOHelmValuesTemplate ¶
type VPOHelmValuesTemplate struct { Image string `json:"image,omitempty"` PrivateRegistry bool `json:"privateRegistry"` Repository string `json:"repository,omitempty"` Registry string `json:"registry,omitempty"` PullPolicy string `json:"pullPolicy,omitempty"` ImagePullSecrets []addonsv1alpha1.SecretName `json:"imagePullSecrets,omitempty"` AppOperatorImage string `json:"appOperatorImage,omitempty"` ClusterOperatorImage string `json:"clusterOperatorImage,omitempty"` }