v1alpha1

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the controlplane v1alpha1 API group +kubebuilder:object:generate=true +groupName=controlplane.cluster.x-k8s.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", 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
)

Functions

This section is empty.

Types

type AddonsSpec added in v0.4.0

type AddonsSpec struct {
	kamajiv1alpha1.AddonsSpec `json:",inline"`

	CoreDNS *CoreDNSAddonSpec `json:"coreDNS,omitempty"` //nolint:tagliatelle
}

AddonsSpec defines the enabled addons and their features.

func (*AddonsSpec) DeepCopy added in v0.4.0

func (in *AddonsSpec) DeepCopy() *AddonsSpec

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

func (*AddonsSpec) DeepCopyInto added in v0.4.0

func (in *AddonsSpec) DeepCopyInto(out *AddonsSpec)

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

type ControlPlaneComponent

type ControlPlaneComponent struct {
	ExtraVolumeMounts []corev1.VolumeMount        `json:"extraVolumeMounts,omitempty"`
	ExtraArgs         []string                    `json:"extraArgs,omitempty"`
	Resources         corev1.ResourceRequirements `json:"resources,omitempty"`
	// In combination with the container registry, it can override the component container image.
	// With no value, the default images will be used.
	// +kubebuilder:validation:MinLength=1
	ContainerImageName string `json:"containerImageName,omitempty"`
}

ControlPlaneComponent allows the customization for the given component of the control plane.

func (*ControlPlaneComponent) DeepCopy

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

func (*ControlPlaneComponent) DeepCopyInto

func (in *ControlPlaneComponent) DeepCopyInto(out *ControlPlaneComponent)

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

type CoreDNSAddonSpec added in v0.4.0

type CoreDNSAddonSpec struct {
	*kamajiv1alpha1.AddonSpec `json:",inline"`
	// +kubebuilder:default={"10.96.0.10"}
	// +kubebuilder:validation:MinItems=1
	DNSServiceIPs []string `json:"dnsServiceIPs,omitempty"`
}

func (*CoreDNSAddonSpec) DeepCopy added in v0.4.0

func (in *CoreDNSAddonSpec) DeepCopy() *CoreDNSAddonSpec

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

func (*CoreDNSAddonSpec) DeepCopyInto added in v0.4.0

func (in *CoreDNSAddonSpec) DeepCopyInto(out *CoreDNSAddonSpec)

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

type DeploymentComponent

type DeploymentComponent struct {
	NodeSelector     map[string]string `json:"nodeSelector,omitempty"`
	RuntimeClassName string            `json:"runtimeClassName,omitempty"`
	// AdditionalMetadata refers to the additional labels and annotations attached
	// to the resulting Deployment managed by Kamaji.
	AdditionalMetadata kamajiv1alpha1.AdditionalMetadata `json:"additionalMetadata,omitempty"`
	// PodAdditionalMetadata defines the additional labels and annotations that must be attached
	// to the resulting Pods managed by the Deployment.
	PodAdditionalMetadata     kamajiv1alpha1.AdditionalMetadata `json:"podAdditionalMetadata,omitempty"`
	ServiceAccountName        string                            `json:"serviceAccountName,omitempty"`
	Strategy                  appsv1.DeploymentStrategy         `json:"strategy,omitempty"`
	Affinity                  *corev1.Affinity                  `json:"affinity,omitempty"`
	Tolerations               []corev1.Toleration               `json:"tolerations,omitempty"`
	TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
	ExtraInitContainers       []corev1.Container                `json:"extraInitContainers,omitempty"`
	ExtraContainers           []corev1.Container                `json:"extraContainers,omitempty"`
	ExtraVolumes              []corev1.Volume                   `json:"extraVolumes,omitempty"`
	// ExternalClusterReference allows defining the target Cluster where the Tenant Control Plane components must be deployed.
	// When this value is nil, the Cluster API management cluster will be used as a target.
	// The ExternalClusterReference feature gate must be enabled with one of the available flags.
	ExternalClusterReference *ExternalClusterReference `json:"externalClusterReference,omitempty"`
}

func (*DeploymentComponent) DeepCopy

func (in *DeploymentComponent) DeepCopy() *DeploymentComponent

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

func (*DeploymentComponent) DeepCopyInto

func (in *DeploymentComponent) DeepCopyInto(out *DeploymentComponent)

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

type ExternalClusterReference added in v0.10.0

type ExternalClusterReference struct {
	// The Secret object containing the kubeconfig used to interact with the remote cluster that will host
	// the Tenant Control Plane resources generated by the Control Plane Provider.
	// +kubebuilder:required
	// +kubebuilder:validation:MinLength=1
	KubeconfigSecretName string `json:"kubeconfigSecretName"`
	// The key used to extract the kubeconfig from the specified Secret.
	// +kubebuilder:required
	// +kubebuilder:validation:MinLength=1
	KubeconfigSecretKey string `json:"kubeconfigSecretKey"`
	// When ExternalClusterReferenceCrossNamespace is enabled allows specifying a different Namespace where the kubeconfig can be retrieved.
	// With ExternalClusterReference this value can be left empty since the KamajiControlPlane object Namespace will be used.
	KubeconfigSecretNamespace string `json:"kubeconfigSecretNamespace,omitempty"`
	// The Namespace where the resulting TenantControlPlane must be deployed to.
	DeploymentNamespace string `json:"deploymentNamespace"`
}

func (*ExternalClusterReference) DeepCopy added in v0.10.0

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

func (*ExternalClusterReference) DeepCopyInto added in v0.10.0

func (in *ExternalClusterReference) DeepCopyInto(out *ExternalClusterReference)

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

type IngressComponent added in v0.3.0

type IngressComponent struct {
	// Defines the Ingress Class for the Ingress object.
	ClassName string `json:"className,omitempty"`
	// Defines the hostname for the Ingress object.
	// When using an Ingress object the FQDN is automatically added to the Certificate SANs.
	// +kubebuilder:required
	// +kubebuilder:validation:MinLength=1
	Hostname string `json:"hostname"`
	// Defines the extra labels for the Ingress object.
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`
	// Defines the extra annotations for the Ingress object.
	// Useful if you need to define TLS/SSL passthrough, or other Ingress Controller-specific options.
	ExtraAnnotations map[string]string `json:"extraAnnotations,omitempty"`
}

func (*IngressComponent) DeepCopy added in v0.3.0

func (in *IngressComponent) DeepCopy() *IngressComponent

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

func (*IngressComponent) DeepCopyInto added in v0.3.0

func (in *IngressComponent) DeepCopyInto(out *IngressComponent)

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

type KamajiControlPlane

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

	Spec   KamajiControlPlaneSpec   `json:"spec,omitempty"`
	Status KamajiControlPlaneStatus `json:"status,omitempty"`
}

KamajiControlPlane is the Schema for the kamajicontrolplanes API.

func (*KamajiControlPlane) DeepCopy

func (in *KamajiControlPlane) DeepCopy() *KamajiControlPlane

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

func (*KamajiControlPlane) DeepCopyInto

func (in *KamajiControlPlane) DeepCopyInto(out *KamajiControlPlane)

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

func (*KamajiControlPlane) DeepCopyObject

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

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

type KamajiControlPlaneConditionType added in v0.4.0

type KamajiControlPlaneConditionType string
var (
	FoundExternalClusterReferenceConditionType  KamajiControlPlaneConditionType = "FoundExternalReferenceClient"
	TenantControlPlaneCreatedConditionType      KamajiControlPlaneConditionType = "TenantControlPlaneCreated"
	TenantControlPlaneAddressReadyConditionType KamajiControlPlaneConditionType = "TenantControlPlaneAddressReady"
	ControlPlaneEndpointPatchedConditionType    KamajiControlPlaneConditionType = "ControlPlaneEndpointPatched"
	InfrastructureClusterPatchedConditionType   KamajiControlPlaneConditionType = "InfrastructureClusterPatched"
	KamajiControlPlaneInitializedConditionType  KamajiControlPlaneConditionType = "KamajiControlPlaneIsInitialized"
	KamajiControlPlaneReadyConditionType        KamajiControlPlaneConditionType = "KamajiControlPlaneIsReady"
	KubeadmResourcesCreatedReadyConditionType   KamajiControlPlaneConditionType = "KubeadmResourcesCreated"
)

type KamajiControlPlaneFields added in v0.10.0

type KamajiControlPlaneFields struct {
	// The Kamaji DataStore to use for the given TenantControlPlane.
	// Retrieve the list of the allowed ones by issuing "kubectl get datastores.kamaji.clastix.io".
	DataStoreName string `json:"dataStoreName,omitempty"`
	// DataStoreSchema allows to specify the name of the database (for relational DataStores) or the key prefix (for etcd)
	DataStoreSchema string `json:"dataStoreSchema,omitempty"`
	// The addons that must be managed by Kamaji, such as CoreDNS, kube-proxy, and konnectivity.
	Addons AddonsSpec `json:"addons,omitempty"`
	// List of the admission controllers to configure for the TenantControlPlane kube-apiserver.
	// By default, no admission controllers are enabled, refer to the desired Kubernetes version.
	//
	// More info: https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/
	AdmissionControllers kamajiv1alpha1.AdmissionControllers `json:"admissionControllers,omitempty"`
	// Override the container registry used to pull the components image.
	// Helpful if running in an air-gapped environment.
	// +kubebuilder:default="registry.k8s.io"
	ContainerRegistry string `json:"registry,omitempty"`

	ControllerManager ControlPlaneComponent `json:"controllerManager,omitempty"`
	ApiServer         ControlPlaneComponent `json:"apiServer,omitempty"` //nolint:revive,stylecheck
	Scheduler         ControlPlaneComponent `json:"scheduler,omitempty"`
	Kine              KineComponent         `json:"kine,omitempty"`
	// Configure the Kubelet options, such as the preferred address types, or the expected cgroupfs.
	// +kubebuilder:default={preferredAddressTypes:{"Hostname","InternalIP","ExternalIP"},cgroupfs:"systemd"}
	Kubelet kamajiv1alpha1.KubeletSpec `json:"kubelet,omitempty"`
	// Configure how the TenantControlPlane should be exposed.
	// +kubebuilder:default={serviceType:"LoadBalancer"}
	Network NetworkComponent `json:"network,omitempty"`
	// Configure how the TenantControlPlane Deployment object should be configured.
	Deployment DeploymentComponent `json:"deployment,omitempty"`
}

func (*KamajiControlPlaneFields) DeepCopy added in v0.10.0

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

func (*KamajiControlPlaneFields) DeepCopyInto added in v0.10.0

func (in *KamajiControlPlaneFields) DeepCopyInto(out *KamajiControlPlaneFields)

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

type KamajiControlPlaneList

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

KamajiControlPlaneList contains a list of KamajiControlPlane.

func (*KamajiControlPlaneList) DeepCopy

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

func (*KamajiControlPlaneList) DeepCopyInto

func (in *KamajiControlPlaneList) DeepCopyInto(out *KamajiControlPlaneList)

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

func (*KamajiControlPlaneList) DeepCopyObject

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

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

type KamajiControlPlaneSpec

type KamajiControlPlaneSpec struct {
	KamajiControlPlaneFields `json:",inline"`
	// ControlPlaneEndpoint propagates the endpoint the Kubernetes API Server managed by Kamaji is located.
	ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"`
	// Number of desired replicas for the given TenantControlPlane.
	// Defaults to 2.
	// +kubebuilder:default=2
	Replicas *int32 `json:"replicas,omitempty"`
	// Version defines the desired Kubernetes version.
	Version string `json:"version"`
}

KamajiControlPlaneSpec defines the desired state of KamajiControlPlane.

func (*KamajiControlPlaneSpec) DeepCopy

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

func (*KamajiControlPlaneSpec) DeepCopyInto

func (in *KamajiControlPlaneSpec) DeepCopyInto(out *KamajiControlPlaneSpec)

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

type KamajiControlPlaneStatus

type KamajiControlPlaneStatus struct {
	// The TenantControlPlane has completed initialization.
	Initialized bool `json:"initialized"`
	// The Kamaji Control Plane is ready to link Cluster API with the Tenant Control Plane.
	Ready bool `json:"ready"`

	// Total number of fully running and ready control plane instances.
	ReadyReplicas int32 `json:"readyReplicas"`
	// Total number of non-terminated control plane instances.
	Replicas int32  `json:"replicas"`
	Selector string `json:"selector"`
	// Total number of unavailable TenantControlPlane instances targeted by this control plane,
	// equal to the desired number of control plane instances - ready instances.
	UnavailableReplicas int32 `json:"unavailableReplicas"`
	// Total number of non-terminated Pods targeted by this control plane that have the desired template spec.
	UpdatedReplicas int32 `json:"updatedReplicas"`
	// ExternalManagedControlPlane indicates to Cluster API that the Control Plane
	// is externally managed by Kamaji.
	// +kubebuilder:default=true
	ExternalManagedControlPlane *bool `json:"externalManagedControlPlane"`
	// Share the failed process of the KamajiControlPlane provider which wasn't able to complete the reconciliation for the given resource.
	FailureReason string `json:"failureReason,omitempty"`
	// The error message, if available, for the failing reconciliation.
	FailureMessage string `json:"failureMessage,omitempty"`
	// String representing the minimum Kubernetes version for the control plane machines in the cluster.
	Version    string             `json:"version"`
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

KamajiControlPlaneStatus defines the observed state of KamajiControlPlane.

func (*KamajiControlPlaneStatus) DeepCopy

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

func (*KamajiControlPlaneStatus) DeepCopyInto

func (in *KamajiControlPlaneStatus) DeepCopyInto(out *KamajiControlPlaneStatus)

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

type KamajiControlPlaneTemplate added in v0.10.0

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

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

KamajiControlPlaneTemplate is the Schema for the kamajicontrolplanetemplates API.

func (*KamajiControlPlaneTemplate) DeepCopy added in v0.10.0

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

func (*KamajiControlPlaneTemplate) DeepCopyInto added in v0.10.0

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

func (*KamajiControlPlaneTemplate) DeepCopyObject added in v0.10.0

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

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

type KamajiControlPlaneTemplateList added in v0.10.0

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

KamajiControlPlaneTemplateList contains a list of KamajiControlPlaneTemplate.

func (*KamajiControlPlaneTemplateList) DeepCopy added in v0.10.0

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

func (*KamajiControlPlaneTemplateList) DeepCopyInto added in v0.10.0

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

func (*KamajiControlPlaneTemplateList) DeepCopyObject added in v0.10.0

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

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

type KamajiControlPlaneTemplateResource added in v0.10.0

type KamajiControlPlaneTemplateResource struct {
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	ObjectMeta clusterv1.ObjectMeta     `json:"metadata,omitempty"`
	Spec       KamajiControlPlaneFields `json:"spec"`
}

KamajiControlPlaneTemplateResource describes the data needed to create a KamajiControlPlane from a template.

func (*KamajiControlPlaneTemplateResource) DeepCopy added in v0.10.0

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

func (*KamajiControlPlaneTemplateResource) DeepCopyInto added in v0.10.0

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

type KamajiControlPlaneTemplateSpec added in v0.10.0

type KamajiControlPlaneTemplateSpec struct {
	Template KamajiControlPlaneTemplateResource `json:"template"`
}

KamajiControlPlaneTemplateSpec defines the desired state of KamajiControlPlaneTemplate.

func (*KamajiControlPlaneTemplateSpec) DeepCopy added in v0.10.0

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

func (*KamajiControlPlaneTemplateSpec) DeepCopyInto added in v0.10.0

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

type KineComponent added in v0.4.0

type KineComponent struct {
	ExtraArgs []string                    `json:"extraArgs,omitempty"`
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

KineComponent allows the customization for the kine component of the control plane. Available only if Kamaji is running using Kine as backing storage.

func (*KineComponent) DeepCopy added in v0.4.0

func (in *KineComponent) DeepCopy() *KineComponent

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

func (*KineComponent) DeepCopyInto added in v0.4.0

func (in *KineComponent) DeepCopyInto(out *KineComponent)

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

type NetworkComponent

type NetworkComponent struct {
	// When specified, the KamajiControlPlane will be reachable using an Ingress object
	// deployed in the management cluster.
	Ingress *IngressComponent `json:"ingress,omitempty"`
	// +kubebuilder:default="LoadBalancer"
	ServiceType kamajiv1alpha1.ServiceType `json:"serviceType,omitempty"`
	// This field can be used in case of pre-assigned address, such as a VIP,
	// helping when serviceType is NodePort.
	ServiceAddress     string            `json:"serviceAddress,omitempty"`
	ServiceLabels      map[string]string `json:"serviceLabels,omitempty"`
	ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
	// Configure additional Subject Address Names for the kube-apiserver certificate,
	// useful if the TenantControlPlane is going to be exposed behind a FQDN with NAT.
	CertSANs []string `json:"certSANs,omitempty"` //nolint:tagliatelle
}

func (*NetworkComponent) DeepCopy

func (in *NetworkComponent) DeepCopy() *NetworkComponent

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

func (*NetworkComponent) DeepCopyInto

func (in *NetworkComponent) DeepCopyInto(out *NetworkComponent)

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