Documentation
¶
Index ¶
- Constants
- Variables
- func AddOrRemoveTaint(clientset kubernetes.Interface, node *corev1.Node, add bool) error
- func ContainsString(slice []string, s string) bool
- func GetPodNameList(pods []corev1.Pod) (result []string)
- func RemoveString(slice []string, s string) (result []string)
- func SetLeaseNamespace(namespace string)
- type NodeMaintenanceReconciler
Constants ¶
const ( LeaseDuration = 3600 * time.Second LeaseHolderIdentity = "node-maintenance" LeaseNamespaceDefault = "node-maintenance" LeaseApiPackage = "coordination.k8s.io/v1" )
const ( MaxAllowedErrorToUpdateOwnedLease = 3 DrainerTimeout = 30 * time.Second WaitDurationOnDrainError = 5 * time.Second FixedDurationReconcileLog = "Reconciling with fixed duration" )
Variables ¶
var KubevirtDrainTaint = &corev1.Taint{ Key: "kubevirt.io/drain", Effect: corev1.TaintEffectNoSchedule, }
var LeaseNamespace = LeaseNamespaceDefault
var MaintenanceTaints = []corev1.Taint{*NodeUnschedulableTaint, *KubevirtDrainTaint}
var NodeUnschedulableTaint = &corev1.Taint{ Key: "node.kubernetes.io/unschedulable", Effect: corev1.TaintEffectNoSchedule, }
Functions ¶
func AddOrRemoveTaint ¶
func ContainsString ¶
ContainsString checks if the string array contains the given string.
func GetPodNameList ¶
GetPodNameList returns a list of pod names from a pod list
func RemoveString ¶
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 ¶
func (r *NodeMaintenanceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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://pkgo.dev/sigs.k8s.io/[email protected]/pkg/reconcile
func (*NodeMaintenanceReconciler) SetupWithManager ¶
func (r *NodeMaintenanceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.