Documentation ¶
Overview ¶
Package helm has the logic to install and uninstall Helm charts.
Index ¶
- Constants
- func NewValues(v Values) map[string]string
- type CLIOptions
- type ChartOptions
- type Installer
- func (i *Installer) GetRelease() (*release.Release, error)
- func (i *Installer) Init(kubeconfigPath string, o ChartOptions) error
- func (i *Installer) Install(ctx context.Context) error
- func (i *Installer) RenderTemplates(ctx context.Context) (RenderedTemplate, error)
- func (i *Installer) Upgrade(ctx context.Context, opts UpgradeOptions) error
- type RenderedTemplate
- type Uninstaller
- type UpgradeOptions
- type Values
Constants ¶
const ( // FlagChartDir is a CLI flag for specifying the chart directory. FlagChartDir = "chart-dir" // FlagRepository is a CLI flag for specifying the Helm repository. FlagRepository = "helm.repository" // FlagHelmSet is a CLI flag for setting Helm values. FlagHelmSet = "helm.set" // FlagHelmValues is a CLI flag for specifying Helm values files. FlagHelmValues = "helm.values" // FlagHelmReuseValues is a CLI flag for reusing Helm values. FlagHelmReuseValues = "helm.reuse-values" // FlagHelmResetValues is a CLI flag for resetting Helm values. FlagHelmResetValues = "helm.reset-values" // FlagHelmResetThenReuseValues is a CLI flag for resetting then reusing Helm values. FlagHelmResetThenReuseValues = "helm.reset-then-reuse-values" )
const ( EverestChartName = "everest" EverestDBNamespaceChartName = "everest-db-namespace" )
Everest Helm chart names.
const DefaultHelmRepoURL = "https://percona.github.io/percona-helm-charts/"
DefaultHelmRepoURL is the default Helm repository URL to download the Everest charts.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLIOptions ¶
type CLIOptions struct { ChartDir string RepoURL string Values values.Options Devel bool ReuseValues bool ResetValues bool ResetThenReuseValues bool }
CLIOptions contains common options for the CLI.
func (*CLIOptions) BindViperFlags ¶
func (o *CLIOptions) BindViperFlags()
BindViperFlags parses the CLI flags from Viper and binds them to the CLI options.
type ChartOptions ¶
type ChartOptions struct { // Directory to load the Helm chart from. // If set, ignores URL. Directory string // URL of the repository to pull the chart from. URL string // Version of the helm chart to install. // If loading from a directory, needs to match the chart version. Version string // Name of the Helm chart to install. // Required only if pulling from the specified URL. Name string }
ChartOptions provide the options for loading a Helm chart.
type Installer ¶
type Installer struct { ReleaseName string ReleaseNamespace string Values map[string]interface{} CreateReleaseNamespace bool // contains filtered or unexported fields }
Installer installs a Helm chart.
func (*Installer) GetRelease ¶
GetRelease gets the installed Helm release.
func (*Installer) Init ¶
func (i *Installer) Init(kubeconfigPath string, o ChartOptions) error
Init initializes the Installer with the specified options.
func (*Installer) Install ¶
Install the Helm chart. Calling Install multiple times is idempotent; it will re-apply the manifests using upgrade.
func (*Installer) RenderTemplates ¶
func (i *Installer) RenderTemplates(ctx context.Context) (RenderedTemplate, error)
RenderTemplates renders the Helm templates from the provided chart. If the chart has been installed, it returns the rendered templates from the installed release. If the chart has not been installed, it returns the rendered templates from a dry-run install. In the latter case, the installation step does not talk to the kube-apiserver. So Helm functions like `lookup` will not work.
type RenderedTemplate ¶
type RenderedTemplate []string
RenderedTemplate represents a Helm template that has been rendered using RenderTemplate(). It is a slice of strings, where each string is a YAML document.
func (*RenderedTemplate) GetCRDs ¶
func (t *RenderedTemplate) GetCRDs() ([]string, error)
GetCRDs returns the CRDs in the RenderedTemplate.
func (*RenderedTemplate) GetEverestCatalogNamespace ¶
func (t *RenderedTemplate) GetEverestCatalogNamespace() (string, error)
GetEverestCatalogNamespace gets the name of the namespace where the Everest catalog is installed.
func (*RenderedTemplate) GetUninstallManifests ¶
func (t *RenderedTemplate) GetUninstallManifests() (RenderedTemplate, error)
GetUninstallManifests returns the uninstall manifests in the RenderedTemplate.
func (*RenderedTemplate) Strings ¶
func (t *RenderedTemplate) Strings() []string
Strings returns the RenderedTemplate as a slice of strings.
type Uninstaller ¶
type Uninstaller struct { ReleaseName string ReleaseNamespace string // contains filtered or unexported fields }
Uninstaller uninstalls a Helm release.
func NewUninstaller ¶
func NewUninstaller(relName, relNamespace, kubeconfigPath string) (*Uninstaller, error)
NewUninstaller creates a new Uninstaller.
type UpgradeOptions ¶
type UpgradeOptions struct { DisableHooks bool ReuseValues bool ResetValues bool ResetThenReuseValues bool Force bool }
UpgradeOptions provide options for upgrading a Helm chart.
type Values ¶
type Values struct { ClusterType kubernetes.ClusterType VersionMetadataURL string }
Values contains the different values that can be set in the Helm chart.