controllers

package
v0.0.0-...-722d744 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RKE2ControlPlaneKind = "RKE2ControlPlane"
)

Variables

This section is empty.

Functions

This section is empty.

Types

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 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, req ctrl.Request) (_ 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
	WatchFilterValue string

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

EtcdSnapshotRestoreReconciler reconciles a EtcdSnapshotRestore object.

func (*EtcdSnapshotRestoreReconciler) Reconcile

Reconcile reconciles the EtcdSnapshotRestore object.

func (*EtcdSnapshotRestoreReconciler) 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

func ETCDRestore(snapshot *snapshotrestorev1.EtcdMachineSnapshot) Instruction

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 {
	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, machine *clusterv1.Machine) *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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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