helm

package
v1.9.0-rc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package helm contains the epinio-specific core to the helm client libraries. It exposes the functionality to deploy and remove helm charts/releases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deploy

func Deploy(logger logr.Logger, parameters ChartParameters) error

func DeployService added in v1.4.0

func DeployService(ctx context.Context, parameters ServiceParameters) error

func Release added in v1.9.0

func Release(ctx context.Context, logger logr.Logger, cluster *kubernetes.Cluster,
	namespace, releaseName string) (*helmrelease.Release, error)

Release returns the named Helm release, including the associated resources. This is the internal equivalent of the `helm status` command.

func Remove

func Remove(cluster *kubernetes.Cluster, logger logr.Logger, app models.AppRef) error

func RemoveService added in v1.4.0

func RemoveService(logger logr.Logger, cluster *kubernetes.Cluster, app models.AppRef) error

func ValidateField added in v1.2.0

func ValidateField(key, value string, spec models.ChartSetting) (interface{}, error)

validateField checks a single custom value against its declaration.

func Values added in v0.6.3

func Values(cluster *kubernetes.Cluster, logger logr.Logger, app models.AppRef) ([]byte, error)

Types

type ChartParameters

type ChartParameters struct {
	models.AppRef                        // Application: name & namespace
	Context        context.Context       // Operation context
	Cluster        *kubernetes.Cluster   // Cluster to talk to.
	Chart          string                // Name of Chart CR to use for deployment
	ImageURL       string                // Application Image
	Username       string                // User causing the (re)deployment
	Instances      int32                 // Number Of Desired Replicas
	StageID        string                // Stage ID that produced ImageURL
	Environment    models.EnvVariableMap // App Environment
	Configurations []ConfigParameter     // Bound Configurations (list of names and paths)
	Routes         []string              // Desired application routes
	Domains        domain.DomainMap      // Map of domains with secrets covering them
	Start          *int64                // Nano-epoch of deployment. Optional. Used to force a restart, even when nothing else has changed.
	Settings       models.ChartValueSettings
}

type ConfigParameter added in v1.5.0

type ConfigParameter struct {
	Name string `yaml:"name"` // Configuration name
	Path string `yaml:"path"` // Mounting path for configuration
}

type ReleaseStatus added in v1.9.0

type ReleaseStatus string

Status is the status of a release

const (
	// StatusUnknown indicates that a release is in an uncertain state.
	StatusUnknown ReleaseStatus = "unknown"
	// StatusReady indicates that all the release's resources are in a ready state.
	StatusReady ReleaseStatus = "ready"
	// StatusNotReady indicates that not all the release's resources are in a ready state.
	StatusNotReady ReleaseStatus = "not-ready"
)

func Status added in v0.6.3

func Status(ctx context.Context, logger logr.Logger, cluster *kubernetes.Cluster,
	release *helmrelease.Release) (ReleaseStatus, error)

Status will check for the readiness of the release returning an internal status instead of the Helm release status (https://github.com/helm/helm/blob/main/pkg/release/status.go). Helm is not checking for the actual status of the release and even if the resources are still in deployment they will be marked as "deployed"

type ServiceParameters added in v1.4.0

type ServiceParameters struct {
	models.AppRef                     // Service: name & namespace
	Cluster       *kubernetes.Cluster // Cluster to talk to.
	Chart         string              // Name of helm chart to deploy
	Version       string              // Version of helm chart to deploy
	Repository    string              // Helm repository holding the chart to deploy
	Values        string              // Chart customization (YAML-formatted string)
	Wait          bool                // Wait for service to deploy
}

type SynchronizedClient added in v1.8.0

type SynchronizedClient struct {
	// contains filtered or unexported fields
}

func GetHelmClient added in v0.6.3

func GetHelmClient(restConfig *rest.Config, logger logr.Logger, namespace string) (*SynchronizedClient, error)

func GetNamespaceSynchronizedHelmClient added in v1.8.0

func GetNamespaceSynchronizedHelmClient(namespace string, helmClient hc.Client) (*SynchronizedClient, error)

func (*SynchronizedClient) AddOrUpdateChartRepo added in v1.8.0

func (c *SynchronizedClient) AddOrUpdateChartRepo(entry repo.Entry) error

AddOrUpdateChartRepo implements helmclient.Client

func (*SynchronizedClient) GetChart added in v1.8.0

func (c *SynchronizedClient) GetChart(chartName string, chartPathOptions *action.ChartPathOptions) (*chart.Chart, string, error)

GetChart implements helmclient.Client

func (*SynchronizedClient) GetRelease added in v1.8.0

func (c *SynchronizedClient) GetRelease(name string) (*helmrelease.Release, error)

GetRelease implements helmclient.Client

func (*SynchronizedClient) GetReleaseValues added in v1.8.0

func (c *SynchronizedClient) GetReleaseValues(name string, allValues bool) (map[string]interface{}, error)

GetReleaseValues implements helmclient.Client

func (*SynchronizedClient) InstallChart added in v1.8.0

InstallChart implements helmclient.Client

func (*SynchronizedClient) InstallOrUpgradeChart added in v1.8.0

func (c *SynchronizedClient) InstallOrUpgradeChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*helmrelease.Release, error)

InstallOrUpgradeChart implements helmclient.Client

func (*SynchronizedClient) LintChart added in v1.8.0

func (c *SynchronizedClient) LintChart(spec *hc.ChartSpec) error

LintChart implements helmclient.Client

func (*SynchronizedClient) ListDeployedReleases added in v1.8.0

func (c *SynchronizedClient) ListDeployedReleases() ([]*helmrelease.Release, error)

ListDeployedReleases implements helmclient.Client

func (*SynchronizedClient) ListReleaseHistory added in v1.8.0

func (c *SynchronizedClient) ListReleaseHistory(name string, max int) ([]*helmrelease.Release, error)

ListReleaseHistory implements helmclient.Client

func (*SynchronizedClient) ListReleasesByStateMask added in v1.8.0

func (c *SynchronizedClient) ListReleasesByStateMask(actions action.ListStates) ([]*helmrelease.Release, error)

ListReleasesByStateMask implements helmclient.Client

func (*SynchronizedClient) RollbackRelease added in v1.8.0

func (c *SynchronizedClient) RollbackRelease(spec *hc.ChartSpec) error

RollbackRelease implements helmclient.Client

func (*SynchronizedClient) SetDebugLog added in v1.8.0

func (c *SynchronizedClient) SetDebugLog(debugLog action.DebugLog)

SetDebugLog implements helmclient.Client

func (*SynchronizedClient) Status added in v1.9.0

func (c *SynchronizedClient) Status(name string) (*helmrelease.Release, error)

Status implements the 'helm status' command, with the ShowResources flag enabled

func (*SynchronizedClient) TemplateChart added in v1.8.0

func (c *SynchronizedClient) TemplateChart(spec *hc.ChartSpec, options *hc.HelmTemplateOptions) ([]byte, error)

TemplateChart implements helmclient.Client

func (*SynchronizedClient) UninstallRelease added in v1.8.0

func (c *SynchronizedClient) UninstallRelease(spec *hc.ChartSpec) error

UninstallRelease implements helmclient.Client

func (*SynchronizedClient) UninstallReleaseByName added in v1.8.0

func (c *SynchronizedClient) UninstallReleaseByName(name string) error

UninstallReleaseByName implements helmclient.Client

func (*SynchronizedClient) UpdateChartRepos added in v1.8.0

func (c *SynchronizedClient) UpdateChartRepos() error

UpdateChartRepos implements helmclient.Client

func (*SynchronizedClient) UpgradeChart added in v1.8.0

UpgradeChart implements helmclient.Client

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL