controllers

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LeaseDuration         = 3600 * time.Second
	LeaseHolderIdentity   = "node-maintenance"
	LeaseNamespaceDefault = "node-maintenance"
	LeaseApiPackage       = "coordination.k8s.io/v1"
)
View Source
const (
	MaxAllowedErrorToUpdateOwnedLease = 3
	DrainerTimeout                    = 30 * time.Second
	WaitDurationOnDrainError          = 5 * time.Second
	FixedDurationReconcileLog         = "Reconciling with fixed duration"
)

Variables

View Source
var KubevirtDrainTaint = &corev1.Taint{
	Key:    "kubevirt.io/drain",
	Effect: corev1.TaintEffectNoSchedule,
}
View Source
var LeaseNamespace = LeaseNamespaceDefault
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.

func SetLeaseNamespace

func SetLeaseNamespace(namespace string)

Types

type NodeMaintenanceReconciler

type NodeMaintenanceReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// 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