controllers

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FixedDurationReconcileLog = "Reconciling with fixed duration"

	//lease consts
	LeaseHolderIdentity = "node-maintenance"
	LeaseDuration       = 3600 * time.Second
	DrainerTimeout      = 30 * time.Second
)

Variables

This section is empty.

Functions

func AddOrRemoveTaint

func AddOrRemoveTaint(clientset kubernetes.Interface, add bool, node *corev1.Node, ctx context.Context) error

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString checks if the string array contains the given string.

func GetPodNameList

func GetPodNameList(pods []corev1.Pod) (result []string)

GetPodNameList returns a list of pod names from a pod list

func GetPodRefList added in v0.19.0

func GetPodRefList(pods []corev1.Pod) (result []v1beta1.PodReference)

GetPodRefList returns a list of pod references.

func RemoveString

func RemoveString(slice []string, s string) (result []string)

RemoveString removes the given string from the string array if exists.

Types

type NodeMaintenanceReconciler

type NodeMaintenanceReconciler struct {
	client.Client
	Scheme       *runtime.Scheme
	MgrConfig    *rest.Config
	LeaseManager lease.Manager
	Recorder     record.EventRecorder
	// contains filtered or unexported fields
}

NodeMaintenanceReconciler reconciles a NodeMaintenance object

func (*NodeMaintenanceReconciler) 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 NodeMaintenance 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.9.2/pkg/reconcile

func (*NodeMaintenanceReconciler) SetupWithManager

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