helm

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StorageMap map[string]NewStorageDriver = map[string]NewStorageDriver{
	"secret":    newSecretStorageDriver,
	"configmap": newConfigMapsStorageDriver,
	"memory":    newMemoryStorageDriver,
}

StorageMap is a map from storage configuration env variables to a function that initializes that Helm storage driver.

Functions

func NewDockerSecretsPostRenderer

func NewDockerSecretsPostRenderer(
	cluster *models.Cluster,
	repo repository.Repository,
	agent *kubernetes.Agent,
	namespace string,
	regs []*models.Registry,
	doAuth *oauth2.Config,
) (postrender.PostRenderer, error)

Types

type Agent

type Agent struct {
	ActionConfig *action.Configuration
	K8sAgent     *kubernetes.Agent
}

Agent is a Helm agent for performing helm operations

func GetAgentFromK8sAgent

func GetAgentFromK8sAgent(stg string, ns string, l *logger.Logger, k8sAgent *kubernetes.Agent) (*Agent, error)

GetAgentFromK8sAgent creates a new Agent

func GetAgentInClusterConfig

func GetAgentInClusterConfig(form *Form, l *logger.Logger) (*Agent, error)

GetAgentInClusterConfig creates a new Agent from inside the cluster using the underlying kubernetes.GetAgentInClusterConfig method

func GetAgentOutOfClusterConfig

func GetAgentOutOfClusterConfig(form *Form, l *logger.Logger) (*Agent, error)

GetAgentOutOfClusterConfig creates a new Agent from outside the cluster using the underlying kubernetes.GetAgentOutOfClusterConfig method

func GetAgentTesting

func GetAgentTesting(form *Form, storage *storage.Storage, l *logger.Logger, k8sAgent *kubernetes.Agent) *Agent

GetAgentTesting creates a new Agent using an optional existing storage class

func (*Agent) GetRelease

func (a *Agent) GetRelease(
	name string,
	version int,
	getDeps bool,
) (*release.Release, error)

GetRelease returns the info of a release.

func (*Agent) GetReleaseHistory

func (a *Agent) GetReleaseHistory(
	name string,
) ([]*release.Release, error)

GetReleaseHistory returns a list of charts for a specific release

func (*Agent) InstallChart

func (a *Agent) InstallChart(
	conf *InstallChartConfig,
	doAuth *oauth2.Config,
) (*release.Release, error)

InstallChart installs a new chart

func (*Agent) InstallChartFromValuesBytes

func (a *Agent) InstallChartFromValuesBytes(
	conf *InstallChartConfig,
	values []byte,
	doAuth *oauth2.Config,
) (*release.Release, error)

InstallChartFromValuesBytes reads the raw values and calls Agent.InstallChart

func (*Agent) ListReleases

func (a *Agent) ListReleases(
	namespace string,
	filter *types.ReleaseListFilter,
) ([]*release.Release, error)

ListReleases lists releases based on a ListFilter

func (*Agent) RollbackRelease

func (a *Agent) RollbackRelease(
	name string,
	version int,
) error

RollbackRelease rolls a release back to a specified revision/version

func (*Agent) UninstallChart

func (a *Agent) UninstallChart(
	name string,
) (*release.UninstallReleaseResponse, error)

UninstallChart uninstalls a chart

func (*Agent) UpgradeRelease

func (a *Agent) UpgradeRelease(
	conf *UpgradeReleaseConfig,
	values string,
	doAuth *oauth2.Config,
) (*release.Release, error)

UpgradeRelease upgrades a specific release with new values.yaml

func (*Agent) UpgradeReleaseByValues

func (a *Agent) UpgradeReleaseByValues(
	conf *UpgradeReleaseConfig,
	doAuth *oauth2.Config,
) (*release.Release, error)

UpgradeReleaseByValues upgrades a release by unmarshaled yaml values

type DockerSecretsPostRenderer

type DockerSecretsPostRenderer struct {
	Cluster   *models.Cluster
	Repo      repository.Repository
	Agent     *kubernetes.Agent
	Namespace string
	DOAuth    *oauth2.Config
	// contains filtered or unexported fields
}

DockerSecretsPostRenderer is a Helm post-renderer that adds image pull secrets to pod specs that would otherwise be unable to pull an image.

The post-renderer currently looks for two types of registries: GCR and ECR (TODO: DOCR and Dockerhub). It also detects if the image pull secret is necessary: if GCR image pulls occur in a GKE cluster in the same project, or if ECR image pulls exist in an EKS cluster in the same organization + region, an image pull is not necessary.

func (*DockerSecretsPostRenderer) Run

func (d *DockerSecretsPostRenderer) Run(
	renderedManifests *bytes.Buffer,
) (modifiedManifests *bytes.Buffer, err error)

type Form

type Form struct {
	Cluster           *models.Cluster `form:"required"`
	Repo              repository.Repository
	DigitalOceanOAuth *oauth2.Config
	Storage           string `json:"storage" form:"oneof=secret configmap memory" default:"secret"`
	Namespace         string `json:"namespace"`
}

Form represents the options for connecting to a cluster and creating a Helm agent

type InstallChartConfig

type InstallChartConfig struct {
	Chart      *chart.Chart
	Name       string
	Namespace  string
	Values     map[string]interface{}
	Cluster    *models.Cluster
	Repo       repository.Repository
	Registries []*models.Registry
}

InstallChartConfig is the config required to install a chart

type NewStorageDriver

type NewStorageDriver func(
	l *logger.Logger,
	v1Interface corev1.CoreV1Interface,
	namespace string,
) *storage.Storage

NewStorageDriver is a function type for returning a new storage driver

type UpgradeReleaseConfig

type UpgradeReleaseConfig struct {
	Name       string
	Values     map[string]interface{}
	Cluster    *models.Cluster
	Repo       repository.Repository
	Registries []*models.Registry

	// Optional, if chart should be overriden
	Chart *chart.Chart
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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