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 ¶
- func Deploy(logger logr.Logger, parameters ChartParameters) error
- func DeployService(ctx context.Context, parameters ServiceParameters) error
- func Release(ctx context.Context, logger logr.Logger, cluster *kubernetes.Cluster, ...) (*helmrelease.Release, error)
- func Remove(cluster *kubernetes.Cluster, logger logr.Logger, app models.AppRef) error
- func RemoveService(logger logr.Logger, cluster *kubernetes.Cluster, app models.AppRef) error
- func ValidateField(key, value string, spec models.ChartSetting) (interface{}, error)
- func Values(cluster *kubernetes.Cluster, logger logr.Logger, app models.AppRef) ([]byte, error)
- type ChartParam
- type ChartParameters
- type ConfigParameter
- type EpinioParam
- type PostDeployFunction
- type ReleaseStatus
- type RouteParam
- type ServiceParameters
- type SynchronizedClient
- func (c *SynchronizedClient) AddOrUpdateChartRepo(entry repo.Entry) error
- func (c *SynchronizedClient) GetChart(chartName string, chartPathOptions *action.ChartPathOptions) (*chart.Chart, string, error)
- func (c *SynchronizedClient) GetRelease(name string) (*helmrelease.Release, error)
- func (c *SynchronizedClient) GetReleaseValues(name string, allValues bool) (map[string]interface{}, error)
- func (c *SynchronizedClient) InstallChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*helmrelease.Release, error)
- func (c *SynchronizedClient) InstallOrUpgradeChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*helmrelease.Release, error)
- func (c *SynchronizedClient) LintChart(spec *hc.ChartSpec) error
- func (c *SynchronizedClient) ListDeployedReleases() ([]*helmrelease.Release, error)
- func (c *SynchronizedClient) ListReleaseHistory(name string, max int) ([]*helmrelease.Release, error)
- func (c *SynchronizedClient) ListReleasesByStateMask(actions action.ListStates) ([]*helmrelease.Release, error)
- func (c *SynchronizedClient) Push(chartref, remote string, opts ...action.PushOpt) (string, error)
- func (c *SynchronizedClient) RegistryLogin(hostname, username, password string, opts ...action.RegistryLoginOpt) error
- func (c *SynchronizedClient) RollbackRelease(spec *hc.ChartSpec) error
- func (c *SynchronizedClient) SetDebugLog(debugLog action.DebugLog)
- func (c *SynchronizedClient) Status(name string) (*helmrelease.Release, error)
- func (c *SynchronizedClient) TemplateChart(spec *hc.ChartSpec, options *hc.HelmTemplateOptions) ([]byte, error)
- func (c *SynchronizedClient) UninstallRelease(spec *hc.ChartSpec) error
- func (c *SynchronizedClient) UninstallReleaseByName(name string) error
- func (c *SynchronizedClient) UpdateChartRepos() error
- func (c *SynchronizedClient) UpgradeChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*helmrelease.Release, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 RemoveService ¶ added in v1.4.0
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.
Types ¶
type ChartParam ¶ added in v1.10.0
type ChartParam struct { Epinio EpinioParam `yaml:"epinio"` Chart map[string]string `yaml:"chartConfig,omitempty"` User map[string]interface{} `yaml:"userConfig,omitempty"` }
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 EpinioParam ¶ added in v1.10.0
type EpinioParam struct { AppName string `yaml:"appName"` Configurations []string `yaml:"configurations"` ConfigPaths []ConfigParameter `yaml:"configpaths"` Env []models.EnvVariable `yaml:"env"` ImageUrl string `yaml:"imageURL"` Ingress string `yaml:"ingress,omitempty"` ReplicaCount int32 `yaml:"replicaCount"` Routes []RouteParam `yaml:"routes"` StageID string `yaml:"stageID"` Start string `yaml:"start,omitempty"` TlsIssuer string `yaml:"tlsIssuer"` Username string `yaml:"username"` }
type PostDeployFunction ¶ added in v1.10.0
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 RouteParam ¶ added in v1.10.0
type ServiceParameters ¶ added in v1.4.0
type ServiceParameters struct { models.AppRef // Service: name & namespace Cluster *kubernetes.Cluster // Cluster to talk to. CatalogService models.CatalogService // CatalogService to deploy Values string // Chart customization (YAML-formatted string) Wait bool // Wait for service to deploy PostDeployHook PostDeployFunction // Hook to call after service deployment }
type SynchronizedClient ¶ added in v1.8.0
type SynchronizedClient struct {
// contains filtered or unexported fields
}
func GetHelmClient ¶ added in v0.6.3
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
func (c *SynchronizedClient) InstallChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*helmrelease.Release, error)
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) RegistryLogin ¶ added in v1.10.0
func (c *SynchronizedClient) RegistryLogin(hostname, username, password string, opts ...action.RegistryLoginOpt) error
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
func (c *SynchronizedClient) UpgradeChart(ctx context.Context, spec *hc.ChartSpec, opts *hc.GenericHelmOptions) (*helmrelease.Release, error)
UpgradeChart implements helmclient.Client