release

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package release provides interfaces and default implementations for a Helm release manager, which is used by the Helm controller and reconciler to manage Helm releases in a cluster based on watched custom resources.

Index

Constants

View Source
const (
	// HelmChartWatchesEnvVar is the environment variable for a YAML
	// configuration file containing mappings of GVKs to helm charts. Use of
	// this environment variable overrides the watch configuration provided
	// by API_VERSION, KIND, and HELM_CHART, and it allows users to configure
	// multiple watches, each with a different chart.
	HelmChartWatchesEnvVar = "HELM_CHART_WATCHES"

	// APIVersionEnvVar is the environment variable for the group and version
	// to be watched using the format `<group>/<version>`
	// (e.g. "example.com/v1alpha1").
	APIVersionEnvVar = "API_VERSION"

	// KindEnvVar is the environment variable for the kind to be watched. The
	// value is typically singular and should be CamelCased (e.g. "MyApp").
	KindEnvVar = "KIND"

	// HelmChartEnvVar is the environment variable for the directory location
	// of the helm chart to be installed for CRs that match the values for the
	// API_VERSION and KIND environment variables.
	HelmChartEnvVar = "HELM_CHART"
)

Variables

View Source
var (
	// ErrNotFound indicates the release was not found.
	ErrNotFound = errors.New("release not found")
)

Functions

func NewManagerFactoriesFromEnv

func NewManagerFactoriesFromEnv(storageBackend *storage.Storage, tillerKubeClient *kube.Client) (map[schema.GroupVersionKind]ManagerFactory, error)

NewManagerFactoriesFromEnv returns a map of managers, keyed by GVK, based on configuration provided in the environment.

func NewManagerFactoriesFromFile

func NewManagerFactoriesFromFile(storageBackend *storage.Storage, tillerKubeClient *kube.Client, path string) (map[schema.GroupVersionKind]ManagerFactory, error)

NewManagerFactoriesFromFile reads the config file at the provided path and returns a map of managers, keyed by each GVK in the config.

Types

type Manager

type Manager interface {
	ReleaseName() string
	IsInstalled() bool
	IsUpdateRequired() bool
	Sync(context.Context) error
	InstallRelease(context.Context) (*rpb.Release, error)
	UpdateRelease(context.Context) (*rpb.Release, *rpb.Release, error)
	ReconcileRelease(context.Context) (*rpb.Release, error)
	UninstallRelease(context.Context) (*rpb.Release, error)
}

Manager manages a Helm release. It can install, update, reconcile, and uninstall a release.

type ManagerFactory

type ManagerFactory interface {
	NewManager(r *unstructured.Unstructured) Manager
}

ManagerFactory creates Managers that are specific to custom resources. It is used by the HelmOperatorReconciler during resource reconciliation, and it improves decoupling between reconciliation logic and the Helm backend components used to manage releases.

func NewManagerFactory

func NewManagerFactory(storageBackend *storage.Storage, tillerKubeClient *kube.Client, chartDir string) ManagerFactory

NewManagerFactory returns a new Helm manager factory capable of installing and uninstalling releases.

Jump to

Keyboard shortcuts

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