helm2

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const TillerWaitRetryDelay = 250 * time.Millisecond
View Source
const TillerWaitTimeout = 10 * time.Second // Should not be less than TillerWaitTimeoutSeconds + TillerWaitRetryDelay
View Source
const TillerWaitTimeoutSeconds = 2

Variables

View Source
var Helm2Path = "helm"
View Source
var TillerConnectAddress string
View Source
var TillerPath = "tiller"
View Source
var TillerProbeConnectAddress string

Functions

func CheckListenAddresses

func CheckListenAddresses(lAddr1, lAddr2 string) error

CheckListenAddresses tries to listen on two addresses. Returns error if ports are already opened by another process.

func GetOpenPortsPair

func GetOpenPortsPair(lAddr1, lAddr2 string) (string, string, error)

GetOpenPortsPair determine two ports ready for listen and randomly selected by OS.

func Init

func Init(options *Helm2Options) error

func InitTillerProcess

func InitTillerProcess(options TillerOptions) error

InitTillerProcess starts tiller as a subprocess. If tiller is exited, addon-operator also exits.

func NewClient

func NewClient(logLabels ...map[string]string) client.HelmClient

func StartAndLogLines

func StartAndLogLines(cmd *exec.Cmd, logLabels map[string]string) error

StartAndLogLines is a non-blocking version of RunAndLogLines in shell-operator/pkg/executor.

func TillerExitHandler

func TillerExitHandler(err error, logEntry *log.Entry)

func TillerHealthHandler

func TillerHealthHandler() func(writer http.ResponseWriter, request *http.Request)

TillerHealthHandler translates tiller's /liveness response

func WaitTillerReady

func WaitTillerReady(addr string, logEntry *log.Entry) error

WaitTillerReady retries helm version command until success.

Types

type Helm2Client

type Helm2Client struct {
	KubeClient klient.Client
	LogEntry   *log.Entry
	Namespace  string
}

func (*Helm2Client) Cmd

func (h *Helm2Client) Cmd(args ...string) (stdout string, stderr string, err error)

Cmd starts Helm with specified arguments. Sets the TILLER_NAMESPACE environment variable before starting, because Addon-operator works with its own Tiller.

func (*Helm2Client) CommandEnv

func (h *Helm2Client) CommandEnv() []string

func (*Helm2Client) DeleteOldFailedRevisions

func (h *Helm2Client) DeleteOldFailedRevisions(releaseName string) error

func (*Helm2Client) DeleteRelease

func (h *Helm2Client) DeleteRelease(releaseName string) (err error)

func (*Helm2Client) DeleteSingleFailedRevision

func (h *Helm2Client) DeleteSingleFailedRevision(releaseName string) (err error)

func (*Helm2Client) GetReleaseValues

func (h *Helm2Client) GetReleaseValues(releaseName string) (utils.Values, error)

func (*Helm2Client) IsReleaseExists

func (h *Helm2Client) IsReleaseExists(releaseName string) (bool, error)

func (*Helm2Client) LastReleaseStatus

func (h *Helm2Client) LastReleaseStatus(releaseName string) (revision string, status string, err error)

TODO get this info from cm Get last known revision and status helm history output: REVISION UPDATED STATUS CHART DESCRIPTION 1 Fri Jul 14 18:25:00 2017 SUPERSEDED symfony-demo-0.1.0 Install complete

func (*Helm2Client) ListReleases

func (h *Helm2Client) ListReleases(labelSelector map[string]string) ([]string, error)

Returns all known releases as strings — "<release_name>.v<release_number>" Helm looks for ConfigMaps by label 'OWNER=TILLER' and gets release info from the 'release' key. https://github.com/kubernetes/helm/blob/8981575082ea6fc2a670f81fb6ca5b560c4f36a7/pkg/storage/driver/cfgmaps.go#L88

func (*Helm2Client) ListReleasesNames

func (h *Helm2Client) ListReleasesNames(labelSelector map[string]string) ([]string, error)

ListReleasesNames returns list of release names without suffixes ".v<release_number>"

func (*Helm2Client) Render

func (h *Helm2Client) Render(releaseName string, chart string, valuesPaths []string, setValues []string, namespace string) (string, error)

ListReleasesNames returns list of release names without suffixes ".v<release_number>"

func (*Helm2Client) UpgradeRelease

func (h *Helm2Client) UpgradeRelease(releaseName string, chart string, valuesPaths []string, setValues []string, namespace string) error

func (*Helm2Client) WithKubeClient

func (h *Helm2Client) WithKubeClient(client klient.Client)

type Helm2Options

type Helm2Options struct {
	Namespace  string
	KubeClient klient.Client
}
var HelmOptions *Helm2Options

type TillerOptions

type TillerOptions struct {
	Namespace          string
	HistoryMax         int32
	ListenAddress      string
	ListenPort         int32
	ProbeListenAddress string
	ProbeListenPort    int32
}

TillerOptions

Jump to

Keyboard shortcuts

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