controllers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Overview

Package controllers implements BYOH infra controllers.

Index

Constants

View Source
const (
	// ProviderIDPrefix prefix for provider id
	ProviderIDPrefix = "byoh://"
	// ProviderIDSuffixLength length of provider id suffix
	ProviderIDSuffixLength = 6
	// RequeueForbyohost requeue delay for byoh host
	RequeueForbyohost = 10 * time.Second
	// RequeueInstallerConfigTime requeue delay for installer config
	RequeueInstallerConfigTime = 10 * time.Second
)

Variables

View Source
var (
	// DefaultAPIEndpointPort default port for the API endpoint
	DefaultAPIEndpointPort = 6443
)

Functions

func ByoHostToByoMachineMapFunc

func ByoHostToByoMachineMapFunc(gvk schema.GroupVersionKind) handler.MapFunc

ByoHostToByoMachineMapFunc returns a handler.ToRequestsFunc that watches for Machine events and returns reconciliation requests for an infrastructure provider object

func GetByoMachineByName added in v0.3.0

func GetByoMachineByName(ctx context.Context, c client.Client, namespace, name string) (*infrav1.ByoMachine, error)

GetByoMachineByName finds and return a ByoMachine object using the specified params.

func GetByoMachinesInCluster

func GetByoMachinesInCluster(
	ctx context.Context,
	controllerClient client.Client,
	namespace, clusterName string) ([]*infrav1.ByoMachine, error)

GetByoMachinesInCluster gets a cluster's ByoMachine resources.

func GetOwnerByoMachine added in v0.3.0

func GetOwnerByoMachine(ctx context.Context, c client.Client, obj *metav1.ObjectMeta) (*infrav1.ByoMachine, error)

GetOwnerByoMachine returns the ByoMachine object owning the current resource.

Types

type BootstrapKubeconfigReconciler added in v0.3.0

type BootstrapKubeconfigReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

BootstrapKubeconfigReconciler reconciles a BootstrapKubeconfig object

func (*BootstrapKubeconfigReconciler) Reconcile added in v0.3.0

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*BootstrapKubeconfigReconciler) SetupWithManager added in v0.3.0

func (r *BootstrapKubeconfigReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ByoAdmissionReconciler added in v0.3.0

type ByoAdmissionReconciler struct {
	ClientSet clientset.Interface
}

ByoAdmissionReconciler reconciles a ByoAdmission object

func (*ByoAdmissionReconciler) Reconcile added in v0.3.0

func (r *ByoAdmissionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile continuosuly checks for CSRs and approves them

func (*ByoAdmissionReconciler) SetupWithManager added in v0.3.0

func (r *ByoAdmissionReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ByoClusterReconciler

type ByoClusterReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ByoClusterReconciler reconciles a ByoCluster object

func (*ByoClusterReconciler) Reconcile

func (r *ByoClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

Reconcile handles the byo cluster reconciliations

func (*ByoClusterReconciler) SetupWithManager

func (r *ByoClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ByoHostReconciler

type ByoHostReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ByoHostReconciler reconciles a ByoHost object

func (*ByoHostReconciler) Reconcile

func (r *ByoHostReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ByoHost object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*ByoHostReconciler) SetupWithManager

func (r *ByoHostReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ByoMachineReconciler

type ByoMachineReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Tracker  *remote.ClusterCacheTracker
	Recorder record.EventRecorder
}

ByoMachineReconciler reconciles a ByoMachine object

func (*ByoMachineReconciler) ClusterToByoMachines

func (r *ByoMachineReconciler) ClusterToByoMachines(logger logr.Logger) handler.MapFunc

ClusterToByoMachines is a handler.ToRequestsFunc to be used to enqeue requests for reconciliation of ByoMachines

func (*ByoMachineReconciler) FetchAttachedByoHost

func (r *ByoMachineReconciler) FetchAttachedByoHost(ctx context.Context, byomachineName, byomachineNamespace string) (*infrav1.ByoHost, error)

FetchAttachedByoHost fetches BYOHost attached to this machine

func (*ByoMachineReconciler) Reconcile

func (r *ByoMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

Reconcile handles ByoMachine events nolint: gocyclo, funlen

func (*ByoMachineReconciler) SetupWithManager

func (r *ByoMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type ByoMachineTemplateReconciler

type ByoMachineTemplateReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ByoMachineTemplateReconciler reconciles a ByoMachineTemplate object

func (*ByoMachineTemplateReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ByoMachineTemplate object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*ByoMachineTemplateReconciler) SetupWithManager

func (r *ByoMachineTemplateReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type K8sInstallerConfigReconciler added in v0.3.0

type K8sInstallerConfigReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

K8sInstallerConfigReconciler reconciles a K8sInstallerConfig object

func (*K8sInstallerConfigReconciler) ByoMachineToK8sInstallerConfigMapFunc added in v0.3.0

func (r *K8sInstallerConfigReconciler) ByoMachineToK8sInstallerConfigMapFunc(o client.Object) []ctrl.Request

ByoMachineToK8sInstallerConfigMapFunc is a handler.ToRequestsFunc to be used to enqeue request for reconciliation of K8sInstallerConfig.

func (*K8sInstallerConfigReconciler) Reconcile added in v0.3.0

func (r *K8sInstallerConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*K8sInstallerConfigReconciler) SetupWithManager added in v0.3.0

func (r *K8sInstallerConfigReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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