controlplane

package
v1.10.6 Latest Latest
Warning

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

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

Documentation

Overview

Copyright 2026.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// AnnotationKeyManagedBy is the annotation key that indicates which controller manages the infrastructure object
	AnnotationKeyManagedBy = "cluster.x-k8s.io/managed-by"

	// AnnotationValueManagedByK0smotron is the value for the managed-by annotation
	AnnotationValueManagedByK0smotron = "k0smotron"

	// AnnotationKeyClusterSpecHash is the annotation key used to store the hash of the desired cluster specification. This
	// is used to detect changes in the specification.
	AnnotationKeyClusterSpecHash = "k0smotron.io/cluster-spec-hash"
)

Variables

View Source
var (
	// ErrNotReady is used to indicate that the control plane is not ready yet.
	ErrNotReady = fmt.Errorf("waiting for the state")
	// ErrNewMachinesNotReady is used to indicate that the new machines are not ready yet.
	ErrNewMachinesNotReady = fmt.Errorf("waiting for new machines: %w", ErrNotReady)
	// FRPTokenNameTemplate is the template for the name of the secret that contains the FRP token.
	FRPTokenNameTemplate = "%s-frp-token"
	// FRPConfigMapNameTemplate is the template for the name of the ConfigMap that contains the FRP configuration.
	FRPConfigMapNameTemplate = "%s-frps-config"
	// FRPDeploymentNameTemplate is the template for the name of the Deployment that runs the FRP server.
	FRPDeploymentNameTemplate = "%s-frps"
	// FRPServiceNameTemplate is the template for the name of the Service that exposes the FRP server.
	FRPServiceNameTemplate = "%s-frps"
)

Functions

This section is empty.

Types

type K0sControlPlaneValidator added in v1.5.4

type K0sControlPlaneValidator struct{}

K0sControlPlaneValidator struct is responsible for validating the K0sControlPlane resource when it is created, updated, or deleted.

NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods, as this struct is used only for temporary operations and does not need to be deeply copied.

func (*K0sControlPlaneValidator) SetupK0sControlPlaneWebhookWithManager added in v1.5.4

func (v *K0sControlPlaneValidator) SetupK0sControlPlaneWebhookWithManager(mgr ctrl.Manager) error

SetupK0sControlPlaneWebhookWithManager registers the webhook for K0sControlPlane in the manager.

func (*K0sControlPlaneValidator) ValidateCreate added in v1.5.4

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

func (*K0sControlPlaneValidator) ValidateDelete added in v1.5.4

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

func (*K0sControlPlaneValidator) ValidateUpdate added in v1.5.4

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

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

type K0sController added in v0.6.0

type K0sController struct {
	client.Client
	SecretCachingClient client.Client
	ClientSet           *kubernetes.Clientset
	RESTConfig          *rest.Config
	// contains filtered or unexported fields
}

K0sController is responsible for reconciling K0sControlPlane objects.

func (*K0sController) Reconcile added in v0.6.0

func (c *K0sController) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, err error)

Reconcile reconciles a K0sControlPlane object.

func (*K0sController) SetupWithManager added in v0.6.0

func (c *K0sController) SetupWithManager(mgr ctrl.Manager, opts controller.Options) error

SetupWithManager sets up the controller with the Manager.

type K0smotronControlPlaneValidator added in v1.6.1

type K0smotronControlPlaneValidator struct {
	// contains filtered or unexported fields
}

K0smotronControlPlaneValidator struct is responsible for validating the K0smotronControlPlane resource when it is created, updated, or deleted.

NOTE: The +kubebuilder:object:generate=false marker prevents controller-gen from generating DeepCopy methods, as this struct is used only for temporary operations and does not need to be deeply copied.

func (*K0smotronControlPlaneValidator) SetupK0smotronControlPlaneWebhookWithManager added in v1.6.1

func (v *K0smotronControlPlaneValidator) SetupK0smotronControlPlaneWebhookWithManager(mgr ctrl.Manager) error

SetupK0smotronControlPlaneWebhookWithManager registers the webhook for K0smotronControlPlane in the manager.

func (*K0smotronControlPlaneValidator) ValidateCreate added in v1.6.1

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

func (*K0smotronControlPlaneValidator) ValidateDelete added in v1.6.1

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

func (*K0smotronControlPlaneValidator) ValidateUpdate added in v1.6.1

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

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

type K0smotronController added in v0.6.0

type K0smotronController struct {
	client.Client
	SecretCachingClient client.Client
	Scheme              *runtime.Scheme
	ClientSet           *kubernetes.Clientset
	RESTConfig          *rest.Config
}

K0smotronController is the controller for K0smotronControlPlane objects.

func (*K0smotronController) Reconcile added in v0.6.0

func (c *K0smotronController) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, err error)

Reconcile reconciles the K0smotronControlPlane to the desired state.

func (*K0smotronController) SetupWithManager added in v0.6.0

func (c *K0smotronController) SetupWithManager(mgr ctrl.Manager, opts crcontroller.Options) error

SetupWithManager sets up the controller with the Manager.

type Scope

type Scope struct {
	Config *cpv1beta1.K0smotronControlPlane
	// ConfigOwner *bsutil.ConfigOwner
	Cluster *clusterv1.Cluster
}

Scope defines the basic context for the reconciliation of a K0smotronControlPlane object.

Jump to

Keyboard shortcuts

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