Documentation
¶
Index ¶
- func CreateValuesSecret(ctx context.Context, name, namespace, values string)
- func DeleteHelmRelease(ctx context.Context, name, namespace string) error
- func InstallApp(ctx context.Context, app *application.Application)
- func InstallHelmRelease(ctx context.Context, cfg HelmReleaseConfig)
- func IsHelmReleaseReady(ctx context.Context, name, namespace string) (bool, error)
- func IsHelmReleaseVersion(ctx context.Context, name, namespace, version string) (bool, error)
- func UpdateHelmReleaseVersion(ctx context.Context, name, namespace, version string)
- type HelmReleaseConfig
- type SourceKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateValuesSecret ¶
CreateValuesSecret creates a Secret containing chart values for a HelmRelease. It ensures the target namespace exists before creating the Secret.
func DeleteHelmRelease ¶
DeleteHelmRelease deletes a HelmRelease CR and its associated values Secret if present.
func InstallApp ¶
func InstallApp(ctx context.Context, app *application.Application)
InstallApp installs the given App then waits for it to be marked as installed. Timeout can be controlled via the provided context
func InstallHelmRelease ¶
func InstallHelmRelease(ctx context.Context, cfg HelmReleaseConfig)
InstallHelmRelease creates a HelmRelease CR and waits for it to become ready. It also ensures that the target and storage namespaces exist before creating the HelmRelease. Timeout can be controlled via the provided context.
func IsHelmReleaseReady ¶
IsHelmReleaseReady checks if a HelmRelease has the Ready condition set to True.
func IsHelmReleaseVersion ¶
IsHelmReleaseVersion checks if a HelmRelease has the expected chart version in its status history.
func UpdateHelmReleaseVersion ¶
UpdateHelmReleaseVersion updates the chart version of an existing HelmRelease. For HelmRepository sources, it updates spec.chart.spec.version. For OCIRepository sources, the version is controlled by the OCIRepository itself, so this is a no-op and the caller should update the OCIRepository instead.
Types ¶
type HelmReleaseConfig ¶
type HelmReleaseConfig struct {
// Name is the name of the HelmRelease resource.
Name string
// Namespace is the namespace where the HelmRelease CR will be created.
Namespace string
// TargetNamespace is the namespace where the Helm chart will be installed.
TargetNamespace string
// StorageNamespace is the namespace used for Helm storage.
// If empty, defaults to the HelmRelease namespace.
StorageNamespace string
// ReleaseName is the Helm release name. If empty, defaults to the HelmRelease name.
ReleaseName string
// ChartName is the name of the chart in the source.
ChartName string
// ChartVersion is the version of the chart to install.
ChartVersion string
// SourceKind specifies the kind of source reference.
// Defaults to SourceKindOCIRepository if not set.
SourceKind SourceKind
// SourceName is the name of the source reference (HelmRepository or OCIRepository).
SourceName string
// SourceNamespace is the namespace of the source reference.
// If empty, defaults to the HelmRelease namespace.
SourceNamespace string
// Values is the raw values YAML to pass to the chart.
Values string
// Interval is the reconciliation interval. Defaults to 5m.
Interval time.Duration
// Timeout is the time to wait for Helm operations. Defaults to 5m.
Timeout time.Duration
// Retries is the number of retries for install/upgrade remediation. Defaults to 10.
Retries *int
// ServiceAccountName is the Kubernetes service account to impersonate when reconciling.
// Required by clusters with the flux-multi-tenancy Kyverno policy.
ServiceAccountName string
}
HelmReleaseConfig holds the configuration needed to create a HelmRelease CR.
type SourceKind ¶
type SourceKind string
SourceKind represents the kind of source reference used by a HelmRelease.
const ( // SourceKindHelmRepository uses spec.chart with a HelmRepository sourceRef. SourceKindHelmRepository SourceKind = "HelmRepository" // SourceKindOCIRepository uses spec.chartRef with an OCIRepository reference. SourceKindOCIRepository SourceKind = "OCIRepository" )