v1alpha1

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true +groupName=helm.open-control-plane.io

Index

Constants

View Source
const (
	SourceKindHelmRepository = "HelmRepository"
	SourceKindGitRepository  = "GitRepository"
	SourceKindOCIRepository  = "OCIRepository"

	// Finalizer is the finalizer used by the HelmDeployer controller.
	Finalizer = GroupName + "/finalizer"

	// AccessFinalizer is the finalizer used by the HelmDeployer's cluster access controller on Cluster resources.
	AccessFinalizer = GroupName + "/access"

	// ConditionPrefixCluster is the prefix for the cluster-related conditions on HelmDeployments.
	ConditionPrefixCluster = "Cluster."

	// ClusterNameLabel is the label key that identifies the name of the cluster associated with a HelmRelease.
	// The cluster namespace does not need an label, as it is always the same one as the resource with the ClusterNameLabel.
	ClusterNameLabel = GroupName + "/cluster-name"

	// HelmDeploymentNameLabel is the label key that identifies the name of the HelmDeployment associated with a HelmRelease or HelmChartSource.
	HelmDeploymentNameLabel = GroupName + "/helmdeployment-name"
	// HelmDeploymentNamespaceLabel is the label key that identifies the namespace of the HelmDeployment associated with a HelmRelease or HelmChartSource.
	HelmDeploymentNamespaceLabel = GroupName + "/helmdeployment-namespace"

	ReasonClusterAccessNotAvailable         = "ClusterAccessNotAvailable"
	ReasonFluxResourcesDeployedAndHealthy   = "FluxResourcesDeployedAndHealthy"
	ReasonWaitingForHelmReleaseHealthy      = "WaitingForHelmReleaseHealthy"
	ReasonWaitingForHelmChartSourceHealthy  = "WaitingForHelmChartSourceHealthy"
	ReasonHelmReleaseDeploymentFailed       = "HelmReleaseDeploymentFailed"
	ReasonHelmChartSourceDeploymentFailed   = "HelmChartSourceDeploymentFailed"
	ReasonFluxResourcesDeleted              = "FluxResourcesDeleted"
	ReasonWaitingForHelmReleaseDeletion     = "WaitingForHelmReleaseDeletion"
	ReasonHelmReleaseDeletionFailed         = "HelmReleaseDeletionFailed"
	ReasonWaitingForHelmChartSourceDeletion = "WaitingForHelmChartSourceDeletion"
	ReasonHelmChartSourceDeletionFailed     = "HelmChartSourceDeletionFailed"
	ReasonTargetClusterInteractionProblem   = "TargetClusterInteractionProblem"
)
View Source
const GroupName = "helm.open-control-plane.io"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error {
		metav1.AddToGroupVersion(scheme, GroupVersion)
		return nil
	})

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func RegisterToSchemeBuilder

func RegisterToSchemeBuilder(types ...runtime.Object)

Types

type ChartSource

type ChartSource struct {
	// ChartName specifies the name of the chart.
	// Can be omitted for oci sources, required for git and helm sources.
	// For git sources, this is the path within the git repository to the chart.
	// For helm sources, append the version to the chart name using '@', e.g. 'external-dns@1.10.0' or omit for latest version.
	// +optional
	ChartName string                     `json:"chartName"`
	Helm      *fluxv1.HelmRepositorySpec `json:"helm,omitempty"`
	Git       *fluxv1.GitRepositorySpec  `json:"git,omitempty"`
	OCI       *fluxv1.OCIRepositorySpec  `json:"oci,omitempty"`
}

ChartSource defines the source of the helm chart in form of a Flux source. Exactly one of 'HelmRepository', 'GitRepository' or 'OCIRepository' must be set. +kubebuilder:validation:ExactlyOneOf=helm;git;oci +kubebuilder:validation:XValidation:rule="(has(self.git) || has(self.helm)) ? (has(self.chartName) && size(self.chartName) > 0) : true", message="chartName must be set for git and helm sources"

func (*ChartSource) DeepCopy

func (in *ChartSource) DeepCopy() *ChartSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChartSource.

func (*ChartSource) DeepCopyInto

func (in *ChartSource) DeepCopyInto(out *ChartSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HelmDeployerConfig

type HelmDeployerConfig struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec HelmDeployerConfigSpec `json:"spec,omitempty"`
}

func (*HelmDeployerConfig) DeepCopy

func (in *HelmDeployerConfig) DeepCopy() *HelmDeployerConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmDeployerConfig.

func (*HelmDeployerConfig) DeepCopyInto

func (in *HelmDeployerConfig) DeepCopyInto(out *HelmDeployerConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HelmDeployerConfig) DeepCopyObject

func (in *HelmDeployerConfig) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HelmDeployerConfigList

type HelmDeployerConfigList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HelmDeployerConfig `json:"items"`
}

func (*HelmDeployerConfigList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmDeployerConfigList.

func (*HelmDeployerConfigList) DeepCopyInto

func (in *HelmDeployerConfigList) DeepCopyInto(out *HelmDeployerConfigList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HelmDeployerConfigList) DeepCopyObject

func (in *HelmDeployerConfigList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HelmDeployerConfigSpec

type HelmDeployerConfigSpec struct {
	// HelmReleaseReconciliationIntervals specifies the reconciliation intervals for the HelmReleases deployed by the operator.
	// +optional
	HelmReleaseReconciliationIntervals HelmReleaseReconciliationIntervalConfig `json:"helmReleaseReconciliationIntervals"`

	// SelectorDefinitions is a list of selector definitions that can be referenced from HelmDeployments.
	// +optional
	SelectorDefinitions map[string]SelectorDefinition `json:"selectorDefinitions,omitempty"`
}

HelmDeployerConfigSpec defines the desired state of HelmDeployerConfig

func (*HelmDeployerConfigSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmDeployerConfigSpec.

func (*HelmDeployerConfigSpec) DeepCopyInto

func (in *HelmDeployerConfigSpec) DeepCopyInto(out *HelmDeployerConfigSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HelmDeployment

type HelmDeployment struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   HelmDeploymentSpec   `json:"spec,omitempty"`
	Status HelmDeploymentStatus `json:"status,omitempty"`
}

func (*HelmDeployment) DeepCopy

func (in *HelmDeployment) DeepCopy() *HelmDeployment

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmDeployment.

func (*HelmDeployment) DeepCopyInto

func (in *HelmDeployment) DeepCopyInto(out *HelmDeployment)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HelmDeployment) DeepCopyObject

func (in *HelmDeployment) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*HelmDeployment) Finalizer

func (hd *HelmDeployment) Finalizer() string

Finalizer returns the HelmDeployment-specific finalizer string. This is e.g. used on Cluster resources. The format is 'helm.open-control-plane.io/<uid>'.

type HelmDeploymentList

type HelmDeploymentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HelmDeployment `json:"items"`
}

func (*HelmDeploymentList) DeepCopy

func (in *HelmDeploymentList) DeepCopy() *HelmDeploymentList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmDeploymentList.

func (*HelmDeploymentList) DeepCopyInto

func (in *HelmDeploymentList) DeepCopyInto(out *HelmDeploymentList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HelmDeploymentList) DeepCopyObject

func (in *HelmDeploymentList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HelmDeploymentSpec

type HelmDeploymentSpec struct {
	// ChartSource is the source of the helm chart.
	ChartSource ChartSource `json:"chartSource"`

	// Selector can select based on identity, purposes and/or labels of a Cluster.
	// It can also reference a selector definition from the provider config.
	// An empty selector matches all Clusters.
	// +optional
	Selector *SelectorOrReference `json:"selector,omitempty"`

	// SecretsToCopy defines which secrets should be copied for this HelmDeployment.
	// This is in addition to any secrets to copy specified in a referenced selector definition in the provider config.
	// If there are overlapping definitions, the secrets specified here take precedence.
	// Opposed to secret references in the provider config, references here refer to secrets in the same namespace as the HelmDeployment.
	// TO BE REFACTORED: We want to move secret copying logic into its own controller at some point.
	// +optional
	SecretsToCopy *SecretsToCopy `json:"secretsToCopy,omitempty"`

	// Namespace is the namespace on the target cluster to use for the helm deployment.
	// If secrets are copied onto the target cluster, they will be copied into this namespace.
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
	Namespace string `json:"namespace"`

	// HelmValues are the helm values to deploy the chart with.
	// There are a few special strings which will be replaced before creating the HelmRelease:
	// - <provider.name> will be replaced with the provider name resource.
	// - <provider.namespace> will be replaced with the namespace that hosts the platform service.
	// - <environment> will be replaced with the environment name of the operator.
	// - <helm.name> will be replaced with the name of the HelmDeployment.
	// - <helm.namespace> will be replaced with the namespace of the HelmDeployment.
	// - <cluster.name> will be replaced with the name of the reconciled Cluster.
	// - <cluster.namespace> will be replaced with the namespace of the reconciled Cluster.
	// +kubebuilder:validation:Type=object
	// +kubebuilder:validation:Schemaless
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	HelmValues *apiextensionsv1.JSON `json:"helmValues,omitempty"`

	// Interval at which to reconcile the Helm release.
	// It can be used to overwrite the default reconciliation interval specified in the provider config.
	// Inherited from HelmRelease spec.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
	// +optional
	Interval *metav1.Duration `json:"interval,omitempty"`

	// ReleaseName used for the Helm release.
	// Defaults to <namespace>--<name>--<hash> (shortened to 63 characters) if not set.
	// Inherited from HelmRelease spec.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=53
	// +optional
	ReleaseName string `json:"releaseName,omitempty"`

	// Timeout to set for the HelmRelease.
	// Flux defaults this to 5 minutes, if not overwritten here.
	// Inherited from HelmRelease spec.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// Install allows to overwrite the default install options for the HelmRelease.
	// Inherited from HelmRelease spec.
	// +optional
	Install *fluxhelmv2.Install `json:"install,omitempty"`

	// Upgrade allows to overwrite the default upgrade options for the HelmRelease.
	// Inherited from HelmRelease spec.
	// +optional
	Upgrade *fluxhelmv2.Upgrade `json:"upgrade,omitempty"`

	// Test allows to overwrite the default test options for the HelmRelease.
	// Inherited from HelmRelease spec.
	// +optional
	Test *fluxhelmv2.Test `json:"test,omitempty"`

	// Rollback allows to overwrite the default rollback options for the HelmRelease.
	// Inherited from HelmRelease spec.
	// +optional
	Rollback *fluxhelmv2.Rollback `json:"rollback,omitempty"`

	// Uninstall allows to overwrite the default uninstall options for the HelmRelease.
	// Inherited from HelmRelease spec.
	// +optional
	Uninstall *fluxhelmv2.Uninstall `json:"uninstall,omitempty"`

	// CommonMetadata allows to specify common metadata for the HelmRelease, e.g. labels and annotations.
	// Inherited from HelmRelease spec.
	// +optional
	CommonMetadata *fluxhelmv2.CommonMetadata `json:"commonMetadata,omitempty"`

	// WaitStrategy allows to specify the HelmRelease's wait strategy.
	// Inherited from HelmRelease spec.
	// +optional
	WaitStrategy *fluxhelmv2.WaitStrategy `json:"waitStrategy,omitempty"`

	// HealthCheckExprs allows to specify custom health checks for the HelmRelease.
	// Inherited from HelmRelease spec.
	// +optional
	HealthCheckExprs []kustomize.CustomHealthCheck `json:"healthCheckExprs,omitempty"`
}

func (*HelmDeploymentSpec) DeepCopy

func (in *HelmDeploymentSpec) DeepCopy() *HelmDeploymentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmDeploymentSpec.

func (*HelmDeploymentSpec) DeepCopyInto

func (in *HelmDeploymentSpec) DeepCopyInto(out *HelmDeploymentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HelmDeploymentStatus

type HelmDeploymentStatus struct {
	commonapi.Status `json:",inline"`
}

func (*HelmDeploymentStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmDeploymentStatus.

func (*HelmDeploymentStatus) DeepCopyInto

func (in *HelmDeploymentStatus) DeepCopyInto(out *HelmDeploymentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HelmReleaseReconciliationIntervalConfig

type HelmReleaseReconciliationIntervalConfig struct {
	// Default is the default interval in which flux reconciles the HelmRelease resource.
	// It applies whenever no specific interval is defined.
	// The default is 1h.
	// +optional
	Default *metav1.Duration `json:"default,omitempty"`

	// Helm is the reconciliation interval for HelmReleases which use a helm repository as source.
	// If not set, the default interval will be used.
	// +optional
	Helm *metav1.Duration `json:"helm,omitempty"`

	// Git is the reconciliation interval for HelmReleases which use a git repository as source.
	// If not set, the default interval will be used.
	// +optional
	Git *metav1.Duration `json:"git,omitempty"`

	// OCI is the reconciliation interval for HelmReleases which use an OCI repository as source.
	// If not set, the default interval will be used.
	// +optional
	OCI *metav1.Duration `json:"oci,omitempty"`
}

func (*HelmReleaseReconciliationIntervalConfig) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmReleaseReconciliationIntervalConfig.

func (*HelmReleaseReconciliationIntervalConfig) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HelmReleaseReconciliationIntervalConfig) IntervalForSourceKind

func (h *HelmReleaseReconciliationIntervalConfig) IntervalForSourceKind(sourceKind string) metav1.Duration

type SecretCopy

type SecretCopy struct {
	// Source references the source secret to copy.
	// It has to be in the namespace the provider pod is running in.
	Source commonapi.LocalObjectReference `json:"source"`
	// Target is the name of the copied secret.
	// If not set, the secret will be copied with the same name as the source secret.
	// +optional
	Target *commonapi.LocalObjectReference `json:"target"`
}

SecretCopy defines the name of the secret to copy and the name of the copied secret. If target is nil or target.name is empty, the secret will be copied with the same name as the source secret.

func (*SecretCopy) DeepCopy

func (in *SecretCopy) DeepCopy() *SecretCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretCopy.

func (*SecretCopy) DeepCopyInto

func (in *SecretCopy) DeepCopyInto(out *SecretCopy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretsToCopy

type SecretsToCopy struct {
	// ToPlatformCluster lists secrets from the provider namespace that should be copied into the cluster's namespace on the platform cluster.
	// This is useful e.g. for pull secrets for the helm chart registry.
	// +optional
	ToPlatformCluster []SecretCopy `json:"toPlatformCluster,omitempty"`
	// ToTargetCluster lists secrets from the provider namespace that should be copied onto the target cluster.
	// The secrets will end up in the namespace that is defined in the HelmDeployment's spec.
	// This allows propagating secrets that are required by the helm chart to the target cluster.
	// +optional
	ToTargetCluster []SecretCopy `json:"toTargetCluster,omitempty"`
}

func (*SecretsToCopy) DeepCopy

func (in *SecretsToCopy) DeepCopy() *SecretsToCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretsToCopy.

func (*SecretsToCopy) DeepCopyInto

func (in *SecretsToCopy) DeepCopyInto(out *SecretsToCopy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SelectorDefinition

type SelectorDefinition struct {
	*clustersv1alpha1.IdentityLabelPurposeSelector `json:",inline"`

	// SecretsToCopy defines which secrets should be copied when this selector is used for a HelmDeployment.
	// References here refer to secrets in the provider namespace.
	// TO BE REFACTORED: We want to move secret copying logic into its own controller at some point.
	// +optional
	SecretsToCopy *SecretsToCopy `json:"secretsToCopy,omitempty"`
}

func (*SelectorDefinition) DeepCopy

func (in *SelectorDefinition) DeepCopy() *SelectorDefinition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectorDefinition.

func (*SelectorDefinition) DeepCopyInto

func (in *SelectorDefinition) DeepCopyInto(out *SelectorDefinition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SelectorOrReference

type SelectorOrReference struct {
	*clustersv1alpha1.IdentityLabelPurposeSelector `json:",inline"`

	// Reference can be used to reference a selector defined in the provider config.
	// If set together with the inline selector, the inline selector takes precedence and the reference is ignored.
	// +optional
	Reference *string `json:"ref,omitempty"`
}

func (*SelectorOrReference) DeepCopy

func (in *SelectorOrReference) DeepCopy() *SelectorOrReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectorOrReference.

func (*SelectorOrReference) DeepCopyInto

func (in *SelectorOrReference) DeepCopyInto(out *SelectorOrReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SelectorOrReference) Resolve

Resolve returns the IdentityLabelPurposeSelector specified by this SelectorOrReference. If the struct holds a non-nil IdentityLabelPurposeSelector, it is returned directly. If it holds a reference, the selector definition with the given name is looked up in the config and returned. Returns an error if the selector is a reference, but the config is either nil or does not contain a selector definition with the given name. Note that the returned IdentityLabelPurposeSelector may be nil, in which case it matches all Clusters. The second return value contains the secrets that should be copied. It is only non-nil, if the selector is a reference and the referenced selector definition contains secrets to copy.

Jump to

Keyboard shortcuts

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