controllers

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 Imports: 25 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

View Source
var MaintenanceTaints = []corev1.Taint{*NodeUnschedulableTaint, *medik8sDrainTaint}
View Source
var NodeUnschedulableTaint = &corev1.Taint{
	Key:    "node.kubernetes.io/unschedulable",
	Effect: corev1.TaintEffectNoSchedule,
}

Functions

func AddOrRemoveTaint

func AddOrRemoveTaint(clientset kubernetes.Interface, node *corev1.Node, add bool) 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 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
	LeaseManager lease.Manager
	// 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