v1beta1

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Overview

Package v1beta1 contains a v1beta1 api for controlplane resources.

+k8s:deepcopy-gen=package

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

Index

Constants

View Source
const (
	// AvailableCondition documents that the first control plane instance has completed the RKE2 initialization
	// and so the control plane is available and an API server instance is ready for processing requests.
	AvailableCondition clusterv1.ConditionType = "Available"

	// WaitingForRKE2ServerReason (Severity=Info) documents a RKE2ControlPlane object waiting for the first
	// control plane instance to complete the RKE2 Server initialization.
	WaitingForRKE2ServerReason = "WaitingForRKE2Server"
)
View Source
const (
	// ControlPlaneComponentsHealthyCondition reports the overall status of control plane components
	// implemented as static pods generated by RKE2 including kube-api-server, kube-controller manager,
	// kube-scheduler and etcd if managed.
	ControlPlaneComponentsHealthyCondition clusterv1.ConditionType = "ControlPlaneComponentsHealthy"

	// ControlPlaneComponentsUnhealthyReason (Severity=Error) documents a control plane component not healthy.
	ControlPlaneComponentsUnhealthyReason = "ControlPlaneComponentsUnhealthy"

	// ControlPlaneComponentsUnknownReason reports a control plane component in unknown status.
	ControlPlaneComponentsUnknownReason = "ControlPlaneComponentsUnknown"

	// ControlPlaneComponentsInspectionFailedReason documents a failure in inspecting the control plane component status.
	ControlPlaneComponentsInspectionFailedReason = "ControlPlaneComponentsInspectionFailed"

	// MachinesSpecUpToDateCondition documents that the spec of the machines controlled by the RKE2ControlPlane
	// is up to date. Whe this condition is false, the RKE2ControlPlane is executing a rolling upgrade.
	MachinesSpecUpToDateCondition clusterv1.ConditionType = "MachinesSpecUpToDate"

	// NodeMetadataUpToDate documents that the metadata of the nodes controlled by the RKE2 machines
	// is up to date. When this condition is false, or missing the node metadata is not propagated.
	NodeMetadataUpToDate clusterv1.ConditionType = "NodeMetadataUpToDate"

	// MachineAgentHealthyCondition reports a machine's rke2 agent's operational status.
	MachineAgentHealthyCondition clusterv1.ConditionType = "AgentHealthy"

	// NodePatchFailedReason (Severity=Error) documents reason why Node object could not be patched.
	NodePatchFailedReason = "NodePatchFailed"

	// PodInspectionFailedReason documents a failure in inspecting the pod status.
	PodInspectionFailedReason = "PodInspectionFailed"

	// PodMissingReason (Severity=Error) documents a pod does not exist.
	PodMissingReason = "PodMissing" // RollingUpdateInProgressReason (Severity=Warning) documents a RKE2ControlPlane object executing a

	// PodFailedReason (Severity=Error) documents if a pod failed during provisioning i.e., e.g CrashLoopbackOff, ImagePullBackOff
	// or if all the containers in a pod have terminated.
	PodFailedReason = "PodFailed"

	// RollingUpdateInProgressReason (Severity=Warning) documents a RKE2ControlPlane object executing a
	// rolling upgrade for aligning the machines spec to the desired state.
	RollingUpdateInProgressReason = "RollingUpdateInProgress"
)
View Source
const (
	// EtcdClusterHealthyCondition documents the overall etcd cluster's health.
	EtcdClusterHealthyCondition clusterv1.ConditionType = "EtcdClusterHealthyCondition"

	// EtcdClusterInspectionFailedReason documents a failure in inspecting the etcd cluster status.
	EtcdClusterInspectionFailedReason = "EtcdClusterInspectionFailed"

	// MachineEtcdMemberHealthyCondition report the machine's etcd member's health status.
	// NOTE: This conditions exists only if a stacked etcd cluster is used.
	MachineEtcdMemberHealthyCondition clusterv1.ConditionType = "EtcdMemberHealthy"

	// EtcdMemberInspectionFailedReason documents a failure in inspecting the etcd member status.
	EtcdMemberInspectionFailedReason = "MemberInspectionFailed"

	// ResizedCondition documents a RKE2ControlPlane that is resizing the set of controlled machines.
	ResizedCondition clusterv1.ConditionType = "Resized"

	// ScalingUpReason (Severity=Info) documents a RKE2ControlPlane that is increasing the number of replicas.
	ScalingUpReason = "ScalingUp"

	// ScalingDownReason (Severity=Info) documents a RKE2ControlPlane that is decreasing the number of replicas.
	ScalingDownReason = "ScalingDown"
)
View Source
const (
	// CertificatesAvailableCondition documents the overall status of the certificates generated by the RKE2ControlPlane.
	CertificatesAvailableCondition clusterv1.ConditionType = "CertificatesAvailable"

	// CertificatesGenerationFailedReason documents a failure in generating the certificates.
	CertificatesGenerationFailedReason string = "CertificateGenerationFailed"
)
View Source
const (
	// RKE2ControlPlaneLegacyFinalizer allows the controller to clean up resources on delete.
	// this is the old finalizer name. It is kept to ensure backward compatibility.
	RKE2ControlPlaneLegacyFinalizer = "rke2.controleplane.cluster.x-k8s.io"
	// RKE2ControlPlaneFinalizer allows the controller to clean up resources on delete.
	RKE2ControlPlaneFinalizer = "rke2.controlplane.cluster.x-k8s.io"

	// RKE2ServerConfigurationAnnotation is a machine annotation that stores the json-marshalled string of RKE2Config
	// This annotation is used to detect any changes in RKE2Config and trigger machine rollout.
	RKE2ServerConfigurationAnnotation = "controlplane.cluster.x-k8s.io/rke2-server-configuration"

	// LegacyRKE2ControlPlane is a controlplane annotation that marks the CP as legacy. This CP will not provide
	// etcd certificate management or etcd membership management.
	LegacyRKE2ControlPlane = "controlplane.cluster.x-k8s.io/legacy"
)
View Source
const (
	// MachinesReadyCondition reports an aggregate of current status of the machines controlled by the RKE2ControlPlane.
	MachinesReadyCondition clusterv1.ConditionType = "MachinesReady"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = schemeBuilder.AddToScheme
)
View Source
var (
	// RegistrationMethodFavourInternalIPs is a registration method where the IP address of the control plane
	// machines are used for registration. For each machine it will check if there is an internal IP address
	// and will use that. If there is no internal IP address it will use the external IP address if there is one.
	RegistrationMethodFavourInternalIPs = RegistrationMethod("internal-first")
	// RegistrationMethodInternalIPs is a registration method where the internal IP address of the control plane
	// machines are used for registration.
	RegistrationMethodInternalIPs = RegistrationMethod("internal-only-ips")
	// RegistrationMethodExternalIPs is a registration method where the external IP address of the control plane
	// machines are used for registration.
	RegistrationMethodExternalIPs = RegistrationMethod("external-only-ips")
	// RegistrationMethodAddress is a registration method where an explicit address supplied at cluster creation
	// time is used for registration. This is for use in LB or VIP scenarios.
	RegistrationMethodAddress = RegistrationMethod("address")
	// RegistrationMethodControlPlaneEndpoint is a registration method where the control plane endpoint from the
	// Cluster is used for registration.
	RegistrationMethodControlPlaneEndpoint = RegistrationMethod("control-plane-endpoint")
)

Functions

func SetupRKE2ControlPlaneTemplateWebhookWithManager added in v0.12.0

func SetupRKE2ControlPlaneTemplateWebhookWithManager(mgr ctrl.Manager) error

SetupRKE2ControlPlaneTemplateWebhookWithManager sets up the Controller Manager for the Webhook for the RKE2ControlPlaneTemplate resource.

func SetupRKE2ControlPlaneWebhookWithManager added in v0.12.0

func SetupRKE2ControlPlaneWebhookWithManager(mgr ctrl.Manager) error

SetupRKE2ControlPlaneWebhookWithManager sets up the Controller Manager for the Webhook for the RKE2ControlPlaneTemplate resource.

Types

type CNI

type CNI string

CNI defines the Cni options for deploying RKE2.

const (
	// Cilium references the RKE2 CNI Plugin "cilium".
	Cilium CNI = "cilium"
	// Calico references the RKE2 CNI Plugin "calico".
	Calico CNI = "calico"
	// Canal references the RKE2 CNI Plugin "canal".
	Canal CNI = "canal"
	// None means that no CNI Plugin will be installed with RKE2, letting the operator install his own CNI afterwards.
	None CNI = "none"
)

type DisableComponents

type DisableComponents struct {
	// KubernetesComponents is a list of Kubernetes components to disable.
	KubernetesComponents []DisabledKubernetesComponent `json:"kubernetesComponents,omitempty"`

	// PluginComponents is a list of PluginComponents to disable.
	PluginComponents []DisabledPluginComponent `json:"pluginComponents,omitempty"`
}

DisableComponents describes components of RKE2 (Kubernetes components and plugin components) that should be disabled.

func (*DisableComponents) DeepCopy

func (in *DisableComponents) DeepCopy() *DisableComponents

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

func (*DisableComponents) DeepCopyInto

func (in *DisableComponents) DeepCopyInto(out *DisableComponents)

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

type DisabledKubernetesComponent

type DisabledKubernetesComponent string

DisabledKubernetesComponent is an enum field that can take one of the following values: scheduler, kubeProxy or cloudController. +kubebuilder:validation:Enum=scheduler;kubeProxy;cloudController

const (
	// Scheduler references the Kube Scheduler Kubernetes components of the control plane/server nodes.
	Scheduler DisabledKubernetesComponent = "scheduler"

	// KubeProxy references the Kube Proxy Kubernetes components on the agents.
	KubeProxy DisabledKubernetesComponent = "kubeProxy"

	// CloudController references the Cloud Controller Manager Kubernetes Components on the control plane / server nodes.
	CloudController DisabledKubernetesComponent = "cloudController"
)

type DisabledPluginComponent

type DisabledPluginComponent string

DisabledPluginComponent selects a plugin Components to be disabled. +kubebuilder:validation:Enum=rke2-coredns;rke2-ingress-nginx;rke2-metrics-server

const (
	// CoreDNS references the RKE2 Plugin "rke2-coredns".
	CoreDNS DisabledPluginComponent = "rke2-coredns"
	// IngressNginx references the RKE2 Plugin "rke2-ingress-nginx".
	IngressNginx DisabledPluginComponent = "rke2-ingress-nginx"
	// MetricsServer references the RKE2 Plugin "rke2-metrics-server".
	MetricsServer DisabledPluginComponent = "rke2-metrics-server"
)

type EtcdBackupConfig

type EtcdBackupConfig struct {
	// DisableAutomaticSnapshots defines the policy for ETCD snapshots.
	// true means automatic snapshots will be scheduled, false means automatic snapshots will not be scheduled.
	//+optional
	DisableAutomaticSnapshots *bool `json:"disableAutomaticSnapshots,omitempty"`

	// SnapshotName Set the base name of etcd snapshots. Default: etcd-snapshot-<unix-timestamp> (default: "etcd-snapshot").
	//+optional
	SnapshotName string `json:"snapshotName,omitempty"`

	// ScheduleCron Snapshot interval time in cron spec. eg. every 5 hours '* */5 * * *' (default: "0 */12 * * *").
	//+optional
	ScheduleCron string `json:"scheduleCron,omitempty"`

	// Retention Number of snapshots to retain Default: 5 (default: 5).
	//+optional
	Retention string `json:"retention,omitempty"`

	// Directory to save db snapshots.
	//+optional
	Directory string `json:"directory,omitempty"`

	// S3 Enable backup to an S3-compatible Object Store.
	//+optional
	S3 *EtcdS3 `json:"s3,omitempty"`
}

EtcdBackupConfig describes the backup configuration for ETCD.

func (*EtcdBackupConfig) DeepCopy

func (in *EtcdBackupConfig) DeepCopy() *EtcdBackupConfig

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

func (*EtcdBackupConfig) DeepCopyInto

func (in *EtcdBackupConfig) DeepCopyInto(out *EtcdBackupConfig)

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

type EtcdConfig

type EtcdConfig struct {
	// ExposeEtcdMetrics defines the policy for ETCD Metrics exposure.
	// if value is true, ETCD metrics will be exposed
	// if value is false, ETCD metrics will NOT be exposed
	// +optional
	ExposeMetrics bool `json:"exposeMetrics,omitempty"`

	// BackupConfig defines how RKE2 will snapshot ETCD: target storage, schedule, etc.
	//+optional
	BackupConfig EtcdBackupConfig `json:"backupConfig,omitempty"`

	// CustomConfig defines the custom settings for ETCD.
	CustomConfig *bootstrapv1.ComponentConfig `json:"customConfig,omitempty"`
}

EtcdConfig regroups the ETCD-specific configuration of the control plane.

func (*EtcdConfig) DeepCopy

func (in *EtcdConfig) DeepCopy() *EtcdConfig

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

func (*EtcdConfig) DeepCopyInto

func (in *EtcdConfig) DeepCopyInto(out *EtcdConfig)

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

type EtcdS3

type EtcdS3 struct {
	// Endpoint S3 endpoint url (default: "s3.amazonaws.com").
	Endpoint string `json:"endpoint"`

	// EndpointCA references the Secret that contains a custom CA that should be trusted to connect to S3 endpoint.
	// The secret must contain a key named "ca.pem" that contains the CA certificate.
	//+optional
	EndpointCASecret *corev1.ObjectReference `json:"endpointCAsecret,omitempty"`

	// EnforceSSLVerify may be set to false to skip verifying the registry's certificate, default is true.
	//+optional
	EnforceSSLVerify bool `json:"enforceSslVerify,omitempty"`

	// S3CredentialSecret is a reference to a Secret containing the Access Key and Secret Key necessary to access the target S3 Bucket.
	// The Secret must contain the following keys: "aws_access_key_id" and "aws_secret_access_key".
	// If empty, the controller will default to IAM authentication
	S3CredentialSecret *corev1.ObjectReference `json:"s3CredentialSecret,omitempty"`

	// Bucket S3 bucket name.
	//+optional
	Bucket string `json:"bucket,omitempty"`

	// Region S3 region / bucket location (optional) (default: "us-east-1").
	//+optional
	Region string `json:"region,omitempty"`

	// Folder S3 folder.
	//+optional
	Folder string `json:"folder,omitempty"`
}

EtcdS3 defines the S3 configuration for ETCD snapshots.

func (*EtcdS3) DeepCopy

func (in *EtcdS3) DeepCopy() *EtcdS3

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

func (*EtcdS3) DeepCopyInto

func (in *EtcdS3) DeepCopyInto(out *EtcdS3)

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

type RKE2ControlPlane

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

	Spec   RKE2ControlPlaneSpec   `json:"spec,omitempty"`
	Status RKE2ControlPlaneStatus `json:"status,omitempty"`
}

RKE2ControlPlane is the Schema for the rke2controlplanes API.

func (*RKE2ControlPlane) DeepCopy

func (in *RKE2ControlPlane) DeepCopy() *RKE2ControlPlane

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

func (*RKE2ControlPlane) DeepCopyInto

func (in *RKE2ControlPlane) DeepCopyInto(out *RKE2ControlPlane)

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

func (*RKE2ControlPlane) DeepCopyObject

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

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

func (*RKE2ControlPlane) GetConditions

func (r *RKE2ControlPlane) GetConditions() clusterv1.Conditions

GetConditions returns the list of conditions for a RKE2ControlPlane object.

func (*RKE2ControlPlane) GetDesiredVersion

func (r *RKE2ControlPlane) GetDesiredVersion() string

GetDesiredVersion returns the desired version of the RKE2ControlPlane using Spec.Version field as a default field.

func (*RKE2ControlPlane) Hub

func (*RKE2ControlPlane) Hub()

Hub is a conversion hub for the RKE2ControlPlane resource.

func (*RKE2ControlPlane) SetConditions

func (r *RKE2ControlPlane) SetConditions(conditions clusterv1.Conditions)

SetConditions sets the list of conditions for a RKE2ControlPlane object.

type RKE2ControlPlaneCustomDefaulter added in v0.12.0

type RKE2ControlPlaneCustomDefaulter struct{}

RKE2ControlPlaneCustomDefaulter struct is responsible for setting default values on the custom resource of the Kind RKE2ControlPlane when those are created or updated. NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods, as it is used only for temporary operations and does not need to be deeply copied. +kubebuilder:object:generate=false

func (*RKE2ControlPlaneCustomDefaulter) Default added in v0.12.0

Default implements webhook.Defaulter so a webhook will be registered for the type.

type RKE2ControlPlaneCustomValidator added in v0.12.0

type RKE2ControlPlaneCustomValidator struct{}

RKE2ControlPlaneCustomValidator struct is responsible for validating the RKE2ControlPlane resource when it is created, updated, or deleted. NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods, as it is used only for temporary operations and does not need to be deeply copied. +kubebuilder:object:generate=false

func (*RKE2ControlPlaneCustomValidator) ValidateCreate added in v0.12.0

ValidateCreate implements webhook.Validator so a webhook will be registered for the type.

func (*RKE2ControlPlaneCustomValidator) ValidateDelete added in v0.12.0

ValidateDelete implements webhook.Validator so a webhook will be registered for the type.

func (*RKE2ControlPlaneCustomValidator) ValidateUpdate added in v0.12.0

func (rv *RKE2ControlPlaneCustomValidator) ValidateUpdate(_ context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.

type RKE2ControlPlaneList

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

RKE2ControlPlaneList contains a list of RKE2ControlPlane.

func (*RKE2ControlPlaneList) DeepCopy

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

func (*RKE2ControlPlaneList) DeepCopyInto

func (in *RKE2ControlPlaneList) DeepCopyInto(out *RKE2ControlPlaneList)

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

func (*RKE2ControlPlaneList) DeepCopyObject

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

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

func (*RKE2ControlPlaneList) Hub

func (*RKE2ControlPlaneList) Hub()

Hub is a conversion hub for the RKE2ControlPlaneList resource.

type RKE2ControlPlaneMachineTemplate

type RKE2ControlPlaneMachineTemplate 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"`

	// InfrastructureRef is a required reference to a custom resource
	// offered by an infrastructure provider.
	InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"`

	// NodeDrainTimeout is the total amount of time that the controller will spend on draining a controlplane node
	// The default value is 0, meaning that the node can be drained without any time limitations.
	// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
	// +optional
	NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"`
}

RKE2ControlPlaneMachineTemplate defines the template for Machines in a RKE2ControlPlane object.

func (*RKE2ControlPlaneMachineTemplate) DeepCopy

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

func (*RKE2ControlPlaneMachineTemplate) DeepCopyInto

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

type RKE2ControlPlaneSpec

type RKE2ControlPlaneSpec struct {
	// RKE2AgentSpec contains the node spec for the RKE2 Control plane nodes.
	bootstrapv1.RKE2ConfigSpec `json:",inline"`

	// Replicas is the number of replicas for the Control Plane.
	Replicas *int32 `json:"replicas,omitempty"`

	// Version defines the desired Kubernetes version.
	// This field takes precedence over RKE2ConfigSpec.AgentConfig.Version (which is deprecated).
	// +kubebuilder:validation:Pattern="(v\\d\\.\\d{2}\\.\\d+\\+rke2r\\d)|^$"
	// +optional
	Version string `json:"version"`

	// MachineTemplate contains information about how machines
	// should be shaped when creating or updating a control plane.
	// +optional
	MachineTemplate RKE2ControlPlaneMachineTemplate `json:"machineTemplate,omitempty"`

	// ServerConfig specifies configuration for the agent nodes.
	//+optional
	ServerConfig RKE2ServerConfig `json:"serverConfig,omitempty"`

	// ManifestsConfigMapReference references a ConfigMap which contains Kubernetes manifests to be deployed automatically on the cluster
	// Each data entry in the ConfigMap will be will be copied to a folder on the control plane nodes that RKE2 scans and uses to deploy manifests.
	//+optional
	ManifestsConfigMapReference corev1.ObjectReference `json:"manifestsConfigMapReference,omitempty"`

	// InfrastructureRef is a required reference to a custom resource
	// offered by an infrastructure provider.
	// This field is deprecated. Use `.machineTemplate.infrastructureRef` instead.
	// +optional
	// +kubebuilder:deprecatedversion:warning="Use `.machineTemplate.infrastructureRef` instead"
	InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"`

	// NodeDrainTimeout is the total amount of time that the controller will spend on draining a controlplane node
	// The default value is 0, meaning that the node can be drained without any time limitations.
	// NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`
	// This field is deprecated. Use `.machineTemplate.nodeDrainTimeout` instead.
	// +optional
	// +kubebuilder:deprecatedversion:warning="Use `.machineTemplate.nodeDrainTimeout` instead"
	NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"`

	// RegistrationMethod is the method to use for registering nodes into the RKE2 cluster.
	// +kubebuilder:validation:Enum=internal-first;internal-only-ips;external-only-ips;address;control-plane-endpoint;""
	// +optional
	RegistrationMethod RegistrationMethod `json:"registrationMethod,omitempty"`

	// RegistrationAddress is an explicit address to use when registering a node. This is required if
	// the registration type is "address". Its for scenarios where a load-balancer or VIP is used.
	// +optional
	RegistrationAddress string `json:"registrationAddress,omitempty"`

	// The RolloutStrategy to use to replace control plane machines with new ones.
	RolloutStrategy *RolloutStrategy `json:"rolloutStrategy"`
}

RKE2ControlPlaneSpec defines the desired state of RKE2ControlPlane.

func (*RKE2ControlPlaneSpec) DeepCopy

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

func (*RKE2ControlPlaneSpec) DeepCopyInto

func (in *RKE2ControlPlaneSpec) DeepCopyInto(out *RKE2ControlPlaneSpec)

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

type RKE2ControlPlaneStatus

type RKE2ControlPlaneStatus struct {
	// Ready indicates the BootstrapData field is ready to be consumed.
	Ready bool `json:"ready,omitempty"`

	// Initialized indicates the target cluster has completed initialization.
	Initialized bool `json:"initialized,omitempty"`

	// DataSecretName is the name of the secret that stores the bootstrap data script.
	// +optional
	DataSecretName *string `json:"dataSecretName,omitempty"`

	// FailureReason will be set on non-retryable errors.
	// +optional
	FailureReason string `json:"failureReason,omitempty"`

	// FailureMessage will be set on non-retryable errors.
	// +optional
	FailureMessage string `json:"failureMessage,omitempty"`

	// ObservedGeneration is the latest generation observed by the controller.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions defines current service state of the RKE2Config.
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`

	// Replicas is the number of replicas current attached to this ControlPlane Resource.
	Replicas int32 `json:"replicas,omitempty"`

	// Version represents the minimum Kubernetes version for the control plane machines
	// in the cluster.
	// +optional
	Version *string `json:"version,omitempty"`

	// ReadyReplicas is the number of replicas current attached to this ControlPlane Resource and that have Ready Status.
	ReadyReplicas int32 `json:"readyReplicas,omitempty"`

	// UpdatedReplicas is the number of replicas current attached to this ControlPlane Resource and that are up-to-date with Control Plane config.
	UpdatedReplicas int32 `json:"updatedReplicas,omitempty"`

	// UnavailableReplicas is the number of replicas current attached to this ControlPlane Resource and that are up-to-date with Control Plane config.
	UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"`

	// AvailableServerIPs is a list of the Control Plane IP adds that can be used to register further nodes.
	// +optional
	AvailableServerIPs []string `json:"availableServerIPs,omitempty"`
}

RKE2ControlPlaneStatus defines the observed state of RKE2ControlPlane.

func (*RKE2ControlPlaneStatus) DeepCopy

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

func (*RKE2ControlPlaneStatus) DeepCopyInto

func (in *RKE2ControlPlaneStatus) DeepCopyInto(out *RKE2ControlPlaneStatus)

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

type RKE2ControlPlaneTemplate

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

	// Spec is the control plane specification for the template resource.
	Spec RKE2ControlPlaneTemplateSpec `json:"spec,omitempty"`
	// Status is the current state of the control plane.
	Status RKE2ControlPlaneStatus `json:"status,omitempty"`
}

RKE2ControlPlaneTemplate is the Schema for the rke2controlplanetemplates API.

func (*RKE2ControlPlaneTemplate) DeepCopy

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

func (*RKE2ControlPlaneTemplate) DeepCopyInto

func (in *RKE2ControlPlaneTemplate) DeepCopyInto(out *RKE2ControlPlaneTemplate)

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

func (*RKE2ControlPlaneTemplate) DeepCopyObject

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

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

func (*RKE2ControlPlaneTemplate) Hub

func (*RKE2ControlPlaneTemplate) Hub()

Hub is a conversion hub for the RKE2ControlPlaneTemplate resource.

type RKE2ControlPlaneTemplateCustomDefaulter added in v0.12.0

type RKE2ControlPlaneTemplateCustomDefaulter struct{}

RKE2ControlPlaneTemplateCustomDefaulter struct is responsible for setting default values on the custom resource of the Kind RKE2ControlPlaneTemplate when those are created or updated. NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods, as it is used only for temporary operations and does not need to be deeply copied. +kubebuilder:object:generate=false

func (*RKE2ControlPlaneTemplateCustomDefaulter) Default added in v0.12.0

Default implements webhook.Defaulter so a webhook will be registered for the type.

type RKE2ControlPlaneTemplateCustomValidator added in v0.12.0

type RKE2ControlPlaneTemplateCustomValidator struct{}

RKE2ControlPlaneTemplateCustomValidator struct is responsible for validating the RKE2ControlPlaneTemplate resource when it is created, updated, or deleted. NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods, as it is used only for temporary operations and does not need to be deeply copied. +kubebuilder:object:generate=false

func (*RKE2ControlPlaneTemplateCustomValidator) ValidateCreate added in v0.12.0

ValidateCreate implements webhook.Validator so a webhook will be registered for the type.

func (*RKE2ControlPlaneTemplateCustomValidator) ValidateDelete added in v0.12.0

ValidateDelete implements webhook.Validator so a webhook will be registered for the type.

func (*RKE2ControlPlaneTemplateCustomValidator) ValidateUpdate added in v0.12.0

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.

type RKE2ControlPlaneTemplateList

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

RKE2ControlPlaneTemplateList contains a list of RKE2ControlPlaneTemplate.

func (*RKE2ControlPlaneTemplateList) DeepCopy

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

func (*RKE2ControlPlaneTemplateList) DeepCopyInto

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

func (*RKE2ControlPlaneTemplateList) DeepCopyObject

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

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

func (*RKE2ControlPlaneTemplateList) Hub

Hub is a conversion hub for the RKE2ControlPlaneTemplateList resource.

type RKE2ControlPlaneTemplateResource

type RKE2ControlPlaneTemplateResource struct {
	// Spec is the specification of the desired behavior of the control plane.
	Spec RKE2ControlPlaneSpec `json:"spec"`
}

RKE2ControlPlaneTemplateResource contains spec for RKE2ControlPlaneTemplate.

func (*RKE2ControlPlaneTemplateResource) DeepCopy

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

func (*RKE2ControlPlaneTemplateResource) DeepCopyInto

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

type RKE2ControlPlaneTemplateSpec

type RKE2ControlPlaneTemplateSpec struct {
	Template RKE2ControlPlaneTemplateResource `json:"template"`
}

RKE2ControlPlaneTemplateSpec defines the desired state of RKE2ControlPlaneTemplate.

func (*RKE2ControlPlaneTemplateSpec) DeepCopy

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

func (*RKE2ControlPlaneTemplateSpec) DeepCopyInto

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

type RKE2ServerConfig

type RKE2ServerConfig struct {
	// AuditPolicySecret path to the file that defines the audit policy configuration.
	//+optional
	AuditPolicySecret *corev1.ObjectReference `json:"auditPolicySecret,omitempty"`

	// BindAddress describes the rke2 bind address (default: 0.0.0.0).
	//+optional
	BindAddress string `json:"bindAddress,omitempty"`

	// AdvertiseAddress IP address that apiserver uses to advertise to members of the cluster (default: node-external-ip/node-ip).
	//+optional
	AdvertiseAddress string `json:"advertiseAddress,omitempty"`

	// TLSSan Add additional hostname or IP as a Subject Alternative Name in the TLS cert.
	//+optional
	TLSSan []string `json:"tlsSan,omitempty"`

	// ServiceNodePortRange is the port range to reserve for services with NodePort visibility (default: "30000-32767").
	//+optional
	ServiceNodePortRange string `json:"serviceNodePortRange,omitempty"`

	// ClusterDNS is the cluster IP for CoreDNS service. Should be in your service-cidr range (default: 10.43.0.10).
	//+optional
	ClusterDNS string `json:"clusterDNS,omitempty"`

	// ClusterDomain is the cluster domain name (default: "cluster.local").
	//+optional
	ClusterDomain string `json:"clusterDomain,omitempty"`

	// DisableComponents lists Kubernetes components and RKE2 plugin components that will be disabled.
	//+optional
	DisableComponents DisableComponents `json:"disableComponents,omitempty"`

	// CNI describes the CNI Plugins to deploy, one of none, calico, canal, cilium;
	// optionally with multus as the first value to enable the multus meta-plugin (default: canal).
	// +kubebuilder:validation:Enum=none;calico;canal;cilium
	//+optional
	CNI CNI `json:"cni,omitempty"`

	// CNIMultusEnable enables multus as the first CNI plugin (default: false).
	// This option will automatically make Multus a primary CNI, and the value, if specified in the CNI field, as a secondary CNI plugin.
	//+optional
	CNIMultusEnable bool `json:"cniMultusEnable,omitempty"`

	// PauseImage Override image to use for pause.
	//+optional
	PauseImage string `json:"pauseImage,omitempty"`

	// Etcd defines optional custom configuration of ETCD.
	//+optional
	Etcd EtcdConfig `json:"etcd,omitempty"`

	// KubeAPIServer defines optional custom configuration of the Kube API Server.
	//+optional
	KubeAPIServer *bootstrapv1.ComponentConfig `json:"kubeAPIServer,omitempty"`

	// KubeControllerManager defines optional custom configuration of the Kube Controller Manager.
	//+optional
	KubeControllerManager *bootstrapv1.ComponentConfig `json:"kubeControllerManager,omitempty"`

	// KubeScheduler defines optional custom configuration of the Kube Scheduler.
	//+optional
	KubeScheduler *bootstrapv1.ComponentConfig `json:"kubeScheduler,omitempty"`

	// CloudControllerManager defines optional custom configuration of the Cloud Controller Manager.
	//+optional
	CloudControllerManager *bootstrapv1.ComponentConfig `json:"cloudControllerManager,omitempty"`

	// CloudProviderName cloud provider name.
	//+optional
	CloudProviderName string `json:"cloudProviderName,omitempty"`
	// CloudProviderConfigMap is a reference to a ConfigMap containing Cloud provider configuration.
	// The config map must contain a key named cloud-config.
	//+optional
	CloudProviderConfigMap *corev1.ObjectReference `json:"cloudProviderConfigMap,omitempty"`
}

RKE2ServerConfig specifies configuration for the agent nodes.

func (*RKE2ServerConfig) DeepCopy

func (in *RKE2ServerConfig) DeepCopy() *RKE2ServerConfig

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

func (*RKE2ServerConfig) DeepCopyInto

func (in *RKE2ServerConfig) DeepCopyInto(out *RKE2ServerConfig)

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

type RegistrationMethod

type RegistrationMethod string

RegistrationMethod defines the methods to use for registering a new node in a cluster.

type RollingUpdate

type RollingUpdate struct {
	// The maximum number of control planes that can be scheduled above or under the
	// desired number of control planes.
	// Value can be an absolute number 1 or 0.
	// Defaults to 1.
	// Example: when this is set to 1, the control plane can be scaled
	// up immediately when the rolling update starts.
	// +optional
	MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"`
}

RollingUpdate is used to control the desired behavior of rolling update.

func (*RollingUpdate) DeepCopy

func (in *RollingUpdate) DeepCopy() *RollingUpdate

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

func (*RollingUpdate) DeepCopyInto

func (in *RollingUpdate) DeepCopyInto(out *RollingUpdate)

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

type RolloutStrategy

type RolloutStrategy struct {
	// Type of rollout. Currently the only supported strategy is "RollingUpdate".
	// Default is RollingUpdate.
	// +optional
	Type RolloutStrategyType `json:"type,omitempty"`

	// Rolling update config params. Present only if RolloutStrategyType = RollingUpdate.
	// +optional
	RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"`
}

RolloutStrategy describes how to replace existing machines with new ones.

func (*RolloutStrategy) DeepCopy

func (in *RolloutStrategy) DeepCopy() *RolloutStrategy

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

func (*RolloutStrategy) DeepCopyInto

func (in *RolloutStrategy) DeepCopyInto(out *RolloutStrategy)

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

type RolloutStrategyType

type RolloutStrategyType string

RolloutStrategyType defines the rollout strategies for a RKE2ControlPlane.

const (
	// RollingUpdateStrategyType replaces the old control planes by new one using rolling update
	// i.e. gradually scale up or down the old control planes and scale up or down the new one.
	RollingUpdateStrategyType RolloutStrategyType = "RollingUpdate"

	// PreTerminateHookCleanupAnnotation is the annotation RKE2 sets on Machines to ensure it can later remove the
	// etcd member right before Machine termination (i.e. before InfraMachine deletion).
	// For RKE2 we need wait for all other pre-terminate hooks to finish to
	// ensure it runs last (thus ensuring that kubelet is still working while other pre-terminate hooks run
	// as it uses kubelet local mode).
	PreTerminateHookCleanupAnnotation = clusterv1.PreTerminateDeleteHookAnnotationPrefix + "/rke2-cleanup"
)

Jump to

Keyboard shortcuts

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