v1alpha1

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the workloadclusteroperator v1alpha1 API group +kubebuilder:object:generate=true +groupName=workloadclusteroperator.sylva

Index

Constants

View Source
const (
	// ReadyCondition indicates the resource is ready and fully reconciled.
	ReadyCondition string = "Ready"

	// ResourcePruningReason represents the fact that
	// one of the managed resources  are being pruned.
	ResourcePruningReason string = "ResourcePruningReason"

	// ResourceNotReadyReason represents the fact that
	// one of the managed resources is not ready.
	ResourceNotReadyReason string = "ResourceNotReady"

	// ValuesSourceNotReadyReason represents the fact that
	// one of the sources referred in valuesFrom is not ready.
	ValuesSourceNotReadyReason string = "ValuesSourceNotReady"

	// ReconciliationSucceededReason represents the fact that
	// the reconciliation succeeded.
	ReconciliationSucceededReason string = "ReconciliationSucceeded"

	// ReconciliationFailedReason represents the fact that
	// the reconciliation failed.
	ReconciliationFailedReason string = "ReconciliationFailed"

	// InvalidPatternDetectedReason is used when an invalid pattern is detected in the spec
	InvalidPatternDetectedReason string = "InvalidPatternDetected"

	// UnmarshalErrorReason indicates an error during unmarshalling of cluster settings
	UnmarshalErrorReason = "UnmarshalError"
)
View Source
const (
	OpenstackInfrastructureProvider = "openstack"
	VsphereInfrastructureProvider   = "vsphere"
	DockerInfrastructureProvider    = "docker"
	Metal3InfrastructureProvider    = "metal3"

	Rke2BootstrapProvider    = "rke2"
	KubeadmBootstrapProvider = "kubeadm"
)

Variables

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

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var DefaultValuesKey = helmv2.ValuesReference{}.GetValuesKey()

Functions

This section is empty.

Types

type ControlPlaneConfig

type ControlPlaneConfig struct {
	// +kubebuilder:validation:Enum=rke2;kubeadm
	// +required
	// Provider specifies how Kubernetes base components are deployed: "kubeadm" for
	// Kubeadm ("cabpk" CAPI provider), "rke2" for Rancher RKE2.
	Provider string `json:"provider"`

	// Number of control plane nodes
	// +kubebuilder:validation:Minimum=1
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`
}

func (*ControlPlaneConfig) DeepCopy

func (in *ControlPlaneConfig) DeepCopy() *ControlPlaneConfig

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

func (*ControlPlaneConfig) DeepCopyInto

func (in *ControlPlaneConfig) DeepCopyInto(out *ControlPlaneConfig)

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

type MachineDeploymentSpec

type MachineDeploymentSpec struct {
	Replicas int32 `json:"replicas"`
}

MachineDeploymentSpec defines sets of cluster nodes (implemented with Cluster API Machine Deployments)

func (*MachineDeploymentSpec) DeepCopy

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

func (*MachineDeploymentSpec) DeepCopyInto

func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec)

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

type ResourceStatus

type ResourceStatus struct {
	// Kind of the resource
	Kind string `json:"kind"`

	// Name of the resource
	Name string `json:"name"`

	// Status of the resource
	Status string `json:"status"`
}

ResourceStatus provides information on managed resources

func (*ResourceStatus) DeepCopy

func (in *ResourceStatus) DeepCopy() *ResourceStatus

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

func (*ResourceStatus) DeepCopyInto

func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)

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

type SecretValuesSpec

type SecretValuesSpec struct {
	Path string `json:"path,omitempty"`
	Key  string `json:"key,omitempty"`
}

Define the relative path / key to access to the Sylva secret storage +kubebuilder:validation:XValidation:rule="!(has(self.path) && self.path.matches('../'))",message="'../' is not allowed in secretValues:path" +kubebuilder:validation:XValidation:rule="!(has(self.key) && self.key.matches('../'))",message="'../' is not allowed in secretValues:key"

func (*SecretValuesSpec) DeepCopy

func (in *SecretValuesSpec) DeepCopy() *SecretValuesSpec

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

func (*SecretValuesSpec) DeepCopyInto

func (in *SecretValuesSpec) DeepCopyInto(out *SecretValuesSpec)

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

type SylvaSourceVersion

type SylvaSourceVersion struct {

	// +optional
	Tag string `json:"tag,omitempty"`

	// +optional
	Branch string `json:"branch,omitempty"`

	// +optional
	Commit string `json:"commit,omitempty"`
}

+kubebuilder:validation:XValidation:rule="has(self.tag) || has(self.branch) || has(self.commit)",message="At least one of 'commit', 'branch', or 'tag' must be specified"

func (*SylvaSourceVersion) DeepCopy

func (in *SylvaSourceVersion) DeepCopy() *SylvaSourceVersion

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

func (*SylvaSourceVersion) DeepCopyInto

func (in *SylvaSourceVersion) DeepCopyInto(out *SylvaSourceVersion)

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

type SylvaWorkloadCluster

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

	Spec SylvaWorkloadClusterSpec `json:"spec,omitempty"`
	// +kubebuilder:default:={"observedGeneration":-1}
	Status SylvaWorkloadClusterStatus `json:"status,omitempty"`
}

SylvaWorkloadCluster is the Schema for the sylvaworkloadclusters API

func (*SylvaWorkloadCluster) DeepCopy

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

func (*SylvaWorkloadCluster) DeepCopyInto

func (in *SylvaWorkloadCluster) DeepCopyInto(out *SylvaWorkloadCluster)

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

func (*SylvaWorkloadCluster) DeepCopyObject

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

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

func (SylvaWorkloadCluster) GetConditions

func (in SylvaWorkloadCluster) GetConditions() []metav1.Condition

GetConditions returns the status conditions of the object.

func (*SylvaWorkloadCluster) SetConditions

func (in *SylvaWorkloadCluster) SetConditions(conditions []metav1.Condition)

SetConditions sets the status conditions on the object.

type SylvaWorkloadClusterList

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

SylvaWorkloadClusterList contains a list of SylvaWorkloadCluster

func (*SylvaWorkloadClusterList) DeepCopy

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

func (*SylvaWorkloadClusterList) DeepCopyInto

func (in *SylvaWorkloadClusterList) DeepCopyInto(out *SylvaWorkloadClusterList)

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

func (*SylvaWorkloadClusterList) DeepCopyObject

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

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

type SylvaWorkloadClusterSpec

type SylvaWorkloadClusterSpec struct {
	// Kubernetes version for the cluster, e.g. "1.27".
	// Note that this is *not* a full version, but only the two first numbers.
	// +kubebuilder:validation:Pattern=`^[1-9]+[0-9]*[.]([1-9]+[0-9]|0)+$`
	// +optional
	K8sVersion string `json:"k8sVersion,omitempty"`

	// +kubebuilder:validation:Enum=openstack;docker;vsphere;metal3
	// Infrastructure specifies the underlying infrastructure provider for the cluster.
	// Supported values and their corresponding Cluster API Providers:
	// "openstack" maps to the Cluster API Provider OpenStack (capo),
	// "vsphere" maps to the Cluster API Provider vSphere (capv),
	// "docker" maps to the Cluster API Provider Docker (capd),
	// "metal3" maps to the Cluster API Provider Metal3 (capm3).
	Infrastructure string `json:"infrastructure"`

	// +optional
	SylvaSourceVersion *SylvaSourceVersion `json:"sylvaSourceVersion"`

	// +required
	ControlPlane *ControlPlaneConfig `json:"controlPlane"`

	// +required
	MachineDeployments map[string]MachineDeploymentSpec `json:"machineDeployments"`

	// ClusterSettings is a free-form JSON that holds specific settings for the cluster.
	// This field will be mapped to SylvaUnitsRelease.spec.values.cluster.
	// Note well that it can't hold sylva-units templated values (strings with '{{ ... }}')
	// +optional
	ClusterSettings apiextensionsv1.JSON `json:"clusterSettings,omitempty"`

	// Defines the units to be enabled in the workload cluster.
	// Each unit is represented as a key in this object with a boolean value indicating its enabled status.
	// +optional
	EnabledUnits map[string]bool `json:"enabledUnits,omitempty"`

	// OverridingValues is a free-form JSON that will be mapped to SylvaUnitsRelease.spec.values.
	// It overrides existing values. Eventually, this field will be removed once the API is stabilized
	// Note well that it can't hold sylva-units templated values (strings with '{{ ... }}')
	// In addition, it can not override values passed through the CRD fields (ex: cluster, k8s_version_short, etc.)
	// +optional
	OverridingValues apiextensionsv1.JSON `json:"overridingValues,omitempty"`

	// ValuesFrom is a list where each item is a reference to a ConfigMap, a Secret, an ExternalSecret, an OCIRepository, or a GitRepository
	// These resources are in the same namespace of the SylvaWorkloadCluster resource
	// The SylvaUnitsFile type is not allowed in the context of SylvaWorkloadCluster
	// +optional
	ValuesFrom []sylvav1alpha1.ValuesFrom `json:"valuesFrom,omitempty"`

	// SylvaUnitsReleasePresets is a list of SylvaUnitsReleasePreset resources.
	// Each of the SylvaUnitsReleasePreset is a bundle of parameters that will be used to populate the SylvaUnitsRelease. They can be defined by the management cluster admin.
	// The first SylvaUnitsReleasePreset in the list should be annotated with workload-cluster.sylva.org/preset-base=true
	// +required
	// +kubebuilder:validation:MinItems=1
	SylvaUnitsReleasePresets []string `json:"sylvaUnitsReleasePresets,omitempty"`

	// Suspend tells the controller to suspend reconciliation for this SylvaUnitsRelease,
	// +kubebuilder:default=false
	// +optional
	Suspend bool `json:"suspend,omitempty"`

	// Indicates that this SylvaWorkloadCluster is meant to adopt a pre-existing workload cluster.
	//
	// When set, no new cluster creation will be done. If no "to be adopted" workload cluster
	// can be found, the resource will remain in error.
	//
	// (the namespace of that to-be-adopted workload cluster should be labelled with
	// "workload-cluster-operator.sylva-project.org/cluster-name: <swc name>" and
	// "workload-cluster-operator.sylva-project.org/cluster-namespace: <swc namespace>")
	//
	// Once the adopted namespace appears in Status.ResourcesStatus[Kind=Namespace] this field
	// can be removed and set back to false. This will have no effect.
	//
	// +optional
	AdoptExistingCluster bool `json:"adoptExistingCluster,omitempty"`
}

SylvaWorkloadClusterSpec defines the desired state of SylvaWorkloadCluster +kubebuilder:validation:XValidation:rule="!has(self.valuesFrom) || !self.valuesFrom.exists(vf, vf.type == 'SylvaUnitsFile')",message="SylvaUnitsFile type is not allowed in valuesFrom"

func (*SylvaWorkloadClusterSpec) DeepCopy

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

func (*SylvaWorkloadClusterSpec) DeepCopyInto

func (in *SylvaWorkloadClusterSpec) DeepCopyInto(out *SylvaWorkloadClusterSpec)

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

type SylvaWorkloadClusterStatus

type SylvaWorkloadClusterStatus struct {
	// ObservedGeneration is the last observed generation.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// This is the status of managed resources
	// +optional
	ResourcesStatus []ResourceStatus `json:"resourcesStatus,omitempty"`
}

SylvaWorkloadClusterStatus defines the observed state of SylvaWorkloadCluster

func (*SylvaWorkloadClusterStatus) DeepCopy

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

func (*SylvaWorkloadClusterStatus) DeepCopyInto

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

Jump to

Keyboard shortcuts

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