controllers

package
v0.0.0-...-233b718 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RKE2ControlPlaneKind = "RKE2ControlPlane"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ETCDMachineSnapshotReconciler

type ETCDMachineSnapshotReconciler struct {
	client.Client
	WatchFilterValue string

	Tracker *remote.ClusterCacheTracker
	Scheme  *runtime.Scheme
	// contains filtered or unexported fields
}

ETCDMachineSnapshotReconciler reconciles an EtcdMachineSnapshot object.

func (*ETCDMachineSnapshotReconciler) Reconcile

func (r *ETCDMachineSnapshotReconciler) Reconcile(ctx context.Context, etcdMachineSnapshot *snapshotrestorev1.ETCDMachineSnapshot) (_ ctrl.Result, reterr error)

Reconcile reconciles the EtcdMachineSnapshot object.

func (*ETCDMachineSnapshotReconciler) SetupWithManager

SetupWithManager sets up the controller with the Manager.

type ETCDSnapshotRestoreReconciler

type ETCDSnapshotRestoreReconciler struct {
	client.Client
}

ETCDSnapshotRestoreReconciler reconciles a ETCDSnapshotRestore object

func (*ETCDSnapshotRestoreReconciler) Reconcile

func (*ETCDSnapshotRestoreReconciler) SetupWithManager

func (r *ETCDSnapshotRestoreReconciler) SetupWithManager(_ context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager sets up the controller with the Manager.

type ETCDSnapshotSecretReconciler

type ETCDSnapshotSecretReconciler struct {
	client.Client
}

ETCDSnapshotSecretReconciler reconciles an EtcdMachineSnapshot object.

func (*ETCDSnapshotSecretReconciler) Reconcile

func (r *ETCDSnapshotSecretReconciler) Reconcile(ctx context.Context, secret *corev1.Secret) (ctrl.Result, error)

Reconcile reconciles the EtcdMachineSnapshot object.

func (*ETCDSnapshotSecretReconciler) SetupWithManager

SetupWithManager sets up the controller with the Manager.

type EtcdSnapshotSyncReconciler

type EtcdSnapshotSyncReconciler struct {
	client.Client
	WatchFilterValue string

	Tracker *remote.ClusterCacheTracker
	// contains filtered or unexported fields
}

EtcdSnapshotSyncReconciler reconciles a EtcdSnapshotSync object.

func (*EtcdSnapshotSyncReconciler) Reconcile

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

func (*EtcdSnapshotSyncReconciler) SetupWithManager

type Instruction

type Instruction struct {
	Name       string   `json:"name,omitempty"`
	Image      string   `json:"image,omitempty"`
	Env        []string `json:"env,omitempty"`
	Args       []string `json:"args,omitempty"`
	Command    string   `json:"command,omitempty"`
	SaveOutput bool     `json:"saveOutput,omitempty"`
}

Instructions is a one time operation, used to perform shell commands on the host

func ETCDRestore

ETCDRestore performs restore form a snapshot path on the init node

func ManifestRemoval

func ManifestRemoval() Instruction

ManifestRemoval cleans up old rke2 manifests on the machine

func RKE2KillAll

func RKE2KillAll() Instruction

RKE2KillAll stops RKE2 server or agent on the node

func RemoveETCDData

func RemoveETCDData() Instruction

RemoveETCDData removes etcd snapshot state form the machine

func RemoveServerURL

func RemoveServerURL() Instruction

RemoveServerURL deletes previous server url from config, allowing nodes to register using new init machine

func SetServerURL

func SetServerURL(serverIP string) Instruction

SetServerURL sets the init machine URL, used to register RKE2 agents

func StartRKE2

func StartRKE2() Instruction

StartRKE2 start the RKE2 service

type Instructions

type Instructions []Instruction

Instructions is a list of instructions

type Output

type Output struct {
	Machine  *clusterv1.Machine
	Finished bool
	Result   map[string][]byte
}

Output holds results of the command execution

type Planner

type Planner struct {
	Name string
	client.Client
	// contains filtered or unexported fields
}

Planner is responsible for executing instructions on the underlying machine host in the specified order, and collecting output from executed steps.

func Plan

func Plan(ctx context.Context, c client.Client, name string, machine *clusterv1.Machine, machines collections.Machines) *Planner

Plan is initializing Planner, used to perform instructions in a specific order and collect results

func (*Planner) Apply

func (p *Planner) Apply(ctx context.Context, instructions ...Instruction) (Output, error)

Apply performs invocation of the supplied set of instructions, and reurns the ongoing state of the command execution

func (*Planner) Output

func (p *Planner) Output() (map[string][]byte, error)

Output retuns structured output from the command invocation

func (*Planner) Permit

func (p *Planner) Permit(ctx context.Context) error

func (*Planner) Revoke

func (p *Planner) Revoke(ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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