Documentation
¶
Index ¶
- Constants
- func NewCreator(logger *zap.SugaredLogger, readFile func(string) ([]byte, error), ...) *creator
- type DiffError
- type EnvironmentSpec
- type EnvironmentTemplateData
- type HelmSpec
- type HelmState
- func (st *HelmState) BuildDeps(helm helmexec.Interface) []error
- func (st *HelmState) Clean() []error
- func (st *HelmState) DeleteReleases(helm helmexec.Interface, purge bool) []error
- func (st *HelmState) DetectReleasesToBeDeleted(helm helmexec.Interface) ([]*ReleaseSpec, error)
- func (st *HelmState) DiffReleases(helm helmexec.Interface, additionalValues []string, workerLimit int, ...) ([]*ReleaseSpec, []error)
- func (st *HelmState) ExecuteTemplates() (*HelmState, error)
- func (st *HelmState) FilterReleases(labels []string) error
- func (st *HelmState) JoinBase(relPath string) string
- func (st *HelmState) LintReleases(helm helmexec.Interface, additionalValues []string, args []string, ...) []error
- func (st *HelmState) PrepareRelease(helm helmexec.Interface, helmfileCommand string) []error
- func (st *HelmState) ReleaseStatuses(helm helmexec.Interface, workerLimit int) []error
- func (st *HelmState) RenderValuesFileToBytes(path string) ([]byte, error)
- func (st *HelmState) SyncReleases(helm helmexec.Interface, additionalValues []string, workerLimit int) []error
- func (st *HelmState) SyncRepos(helm RepoUpdater) []error
- func (st *HelmState) TemplateReleases(helm helmexec.Interface, additionalValues []string, args []string, ...) []error
- func (st *HelmState) TestReleases(helm helmexec.Interface, cleanup bool, timeout int, concurrency int) []error
- func (st *HelmState) UpdateDeps(helm helmexec.Interface) []error
- type LabelFilter
- type ReleaseError
- type ReleaseFilter
- type ReleaseSpec
- type ReleaseTemplateData
- type RepoUpdater
- type RepositorySpec
- type SetValue
- type StateLoadError
- type TemplateSpec
- type UndefinedEnvError
Constants ¶
const DefaultEnv = "default"
Variables ¶
This section is empty.
Functions ¶
func NewCreator ¶ added in v0.33.4
Types ¶
type DiffError ¶ added in v0.32.0
type DiffError struct {
*ReleaseSpec
Code int
// contains filtered or unexported fields
}
type EnvironmentSpec ¶ added in v0.28.0
type EnvironmentTemplateData ¶ added in v0.42.0
type EnvironmentTemplateData struct {
// Environment is accessible as `.Environment` from any template executed by the renderer
Environment environment.Environment
// Namespace is accessible as `.Namespace` from any non-values template executed by the renderer
Namespace string
}
EnvironmentTemplateData provides variables accessible while executing golang text/template expressions in helmfile and values YAML files
type HelmSpec ¶ added in v0.20.0
type HelmSpec struct {
KubeContext string `yaml:"kubeContext"`
TillerNamespace string `yaml:"tillerNamespace"`
Args []string `yaml:"args"`
Verify bool `yaml:"verify"`
// Devel, when set to true, use development versions, too. Equivalent to version '>0.0.0-0'
Devel bool `yaml:"devel"`
// Wait, if set to true, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful
Wait bool `yaml:"wait"`
// Timeout is the time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks, and waits on pod/pvc/svc/deployment readiness) (default 300)
Timeout int `yaml:"timeout"`
// RecreatePods, when set to true, instruct helmfile to perform pods restart for the resource if applicable
RecreatePods bool `yaml:"recreatePods"`
// Force, when set to true, forces resource update through delete/recreate if needed
Force bool `yaml:"force"`
// Atomic, when set to true, restore previous state in case of a failed install/upgrade attempt
Atomic bool `yaml:"atomic"`
}
HelmSpec to defines helmDefault values
type HelmState ¶
type HelmState struct {
Environments map[string]EnvironmentSpec
FilePath string
HelmDefaults HelmSpec `yaml:"helmDefaults"`
Helmfiles []string `yaml:"helmfiles"`
DeprecatedContext string `yaml:"context"`
DeprecatedReleases []ReleaseSpec `yaml:"charts"`
Namespace string `yaml:"namespace"`
Repositories []RepositorySpec `yaml:"repositories"`
Releases []ReleaseSpec `yaml:"releases"`
Templates map[string]TemplateSpec `yaml:"templates"`
Env environment.Environment
// contains filtered or unexported fields
}
HelmState structure for the helmfile
func (*HelmState) BuildDeps ¶ added in v0.45.0
BuildDeps wrapper for building dependencies on the releases
func (*HelmState) DeleteReleases ¶
DeleteReleases wrapper for executing helm delete on the releases
func (*HelmState) DetectReleasesToBeDeleted ¶ added in v0.36.0
func (st *HelmState) DetectReleasesToBeDeleted(helm helmexec.Interface) ([]*ReleaseSpec, error)
func (*HelmState) DiffReleases ¶
func (st *HelmState) DiffReleases(helm helmexec.Interface, additionalValues []string, workerLimit int, detailedExitCode, suppressSecrets bool, triggerCleanupEvents bool) ([]*ReleaseSpec, []error)
DiffReleases wrapper for executing helm diff on the releases It returns releases that had any changes
func (*HelmState) ExecuteTemplates ¶ added in v0.42.0
func (*HelmState) FilterReleases ¶
FilterReleases allows for the execution of helm commands against a subset of the releases in the helmfile.
func (*HelmState) JoinBase ¶ added in v0.33.2
JoinBase returns an absolute path in the form basePath/relative
func (*HelmState) LintReleases ¶ added in v0.20.0
func (st *HelmState) LintReleases(helm helmexec.Interface, additionalValues []string, args []string, workerLimit int) []error
LintReleases wrapper for executing helm lint on the releases
func (*HelmState) PrepareRelease ¶ added in v0.37.0
func (*HelmState) ReleaseStatuses ¶ added in v0.14.0
func (*HelmState) RenderValuesFileToBytes ¶ added in v0.28.0
func (*HelmState) SyncReleases ¶
func (st *HelmState) SyncReleases(helm helmexec.Interface, additionalValues []string, workerLimit int) []error
SyncReleases wrapper for executing helm upgrade on the releases
func (*HelmState) SyncRepos ¶
func (st *HelmState) SyncRepos(helm RepoUpdater) []error
SyncRepos will update the given helm releases
func (*HelmState) TemplateReleases ¶ added in v0.31.0
func (st *HelmState) TemplateReleases(helm helmexec.Interface, additionalValues []string, args []string, workerLimit int) []error
TemplateReleases wrapper for executing helm template on the releases
type LabelFilter ¶
type LabelFilter struct {
// contains filtered or unexported fields
}
LabelFilter matches a release with the given positive lables. Negative labels invert the match for cases such as tier!=backend
func ParseLabels ¶
func ParseLabels(l string) (LabelFilter, error)
ParseLabels takes a label in the form foo=bar,baz!=bat and returns a LabelFilter that will match the labels
func (LabelFilter) Match ¶
func (l LabelFilter) Match(r ReleaseSpec) bool
Match will match a release that has the same labels as the filter
type ReleaseError ¶ added in v0.23.0
type ReleaseError struct {
*ReleaseSpec
// contains filtered or unexported fields
}
func (*ReleaseError) Error ¶ added in v0.23.0
func (e *ReleaseError) Error() string
type ReleaseFilter ¶
type ReleaseFilter interface {
// Match returns true if the ReleaseSpec matches the Filter
Match(r ReleaseSpec) bool
}
ReleaseFilter is used to determine if a given release should be used during helmfile execution
type ReleaseSpec ¶
type ReleaseSpec struct {
// Chart is the name of the chart being installed to create this release
Chart string `yaml:"chart"`
Version string `yaml:"version"`
Verify *bool `yaml:"verify"`
// Devel, when set to true, use development versions, too. Equivalent to version '>0.0.0-0'
Devel *bool `yaml:"devel"`
// Wait, if set to true, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful
Wait *bool `yaml:"wait"`
// Timeout is the time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks, and waits on pod/pvc/svc/deployment readiness) (default 300)
Timeout *int `yaml:"timeout"`
// RecreatePods, when set to true, instruct helmfile to perform pods restart for the resource if applicable
RecreatePods *bool `yaml:"recreatePods"`
// Force, when set to true, forces resource update through delete/recreate if needed
Force *bool `yaml:"force"`
// Installed, when set to true, `delete --purge` the release
Installed *bool `yaml:"installed"`
// Atomic, when set to true, restore previous state in case of a failed install/upgrade attempt
Atomic *bool `yaml:"atomic"`
// MissingFileHandler is set to either "Error" or "Warn". "Error" instructs helmfile to fail when unable to find a values or secrets file. When "Warn", it prints the file and continues.
// The default value for MissingFileHandler is "Error".
MissingFileHandler *string `yaml:"missingFileHandler"`
// Hooks is a list of extension points paired with operations, that are executed in specific points of the lifecycle of releases defined in helmfile
Hooks []event.Hook `yaml:"hooks"`
// Name is the name of this release
Name string `yaml:"name"`
Namespace string `yaml:"namespace"`
Labels map[string]string `yaml:"labels"`
Values []interface{} `yaml:"values"`
Secrets []string `yaml:"secrets"`
SetValues []SetValue `yaml:"set"`
// The 'env' section is not really necessary any longer, as 'set' would now provide the same functionality
EnvValues []SetValue `yaml:"env"`
ValuesPathPrefix string `yaml:"valuesPathPrefix"`
// contains filtered or unexported fields
}
ReleaseSpec defines the structure of a helm release
func (ReleaseSpec) Clone ¶ added in v0.42.0
func (r ReleaseSpec) Clone() (*ReleaseSpec, error)
func (ReleaseSpec) ExecuteTemplateExpressions ¶ added in v0.42.0
func (r ReleaseSpec) ExecuteTemplateExpressions(renderer *tmpl.FileRenderer) (*ReleaseSpec, error)
type ReleaseTemplateData ¶ added in v0.42.0
type ReleaseTemplateData struct {
// Environment is accessible as `.Environment` from any template expression executed by the renderer
Environment environment.Environment
// Release is accessible as `.Release` from any template expression executed by the renderer
Release ReleaseSpec
}
ReleaseTemplateData provides variables accessible while executing golang text/template expressions in releases of a helmfile YAML file
type RepoUpdater ¶ added in v0.38.0
type RepositorySpec ¶
type RepositorySpec struct {
Name string `yaml:"name"`
URL string `yaml:"url"`
CertFile string `yaml:"certFile"`
KeyFile string `yaml:"keyFile"`
Username string `yaml:"username"`
Password string `yaml:"password"`
}
RepositorySpec that defines values for a helm repo
type SetValue ¶
type SetValue struct {
Name string `yaml:"name"`
Value string `yaml:"value"`
File string `yaml:"file"`
Values []string `yaml:"values"`
}
SetValue are the key values to set on a helm release
type StateLoadError ¶ added in v0.32.0
type StateLoadError struct {
Cause error
// contains filtered or unexported fields
}
func (*StateLoadError) Error ¶ added in v0.32.0
func (e *StateLoadError) Error() string
type TemplateSpec ¶ added in v0.42.0
type TemplateSpec struct {
ReleaseSpec `yaml:",inline"`
}
TemplateSpec defines the structure of a reusable and composable template for helm releases.
type UndefinedEnvError ¶ added in v0.32.0
type UndefinedEnvError struct {
// contains filtered or unexported fields
}
func (*UndefinedEnvError) Error ¶ added in v0.32.0
func (e *UndefinedEnvError) Error() string