controllers

package
v0.0.0-...-23e2bcd Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const EvictionSurgeReplicasAnnotationKey = "evictionSurgeReplicas"
View Source
const NodeNameIndex = "spec.nodeName"

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentToPDBReconciler

type DeploymentToPDBReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

DeploymentToPDBReconciler reconciles a Deployment object and ensures an associated PDB is created and deleted

func (*DeploymentToPDBReconciler) Reconcile

Reconcile watches for Deployment changes (created, updated, deleted) and creates or deletes the associated PDB. creates pdb with minAvailable to be same as replicas for any deployment

func (*DeploymentToPDBReconciler) SetupWithManager

func (r *DeploymentToPDBReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type DeploymentWrapper

type DeploymentWrapper struct {
	// contains filtered or unexported fields
}

func (*DeploymentWrapper) AddAnnotation

func (d *DeploymentWrapper) AddAnnotation(status, newReplicas string)

AddAnnotation add new status annotation

func (*DeploymentWrapper) GetMaxSurge

func (d *DeploymentWrapper) GetMaxSurge() intstr.IntOrString

func (*DeploymentWrapper) GetReplicas

func (d *DeploymentWrapper) GetReplicas() int32

func (*DeploymentWrapper) Obj

func (d *DeploymentWrapper) Obj() client.Object

func (*DeploymentWrapper) RemoveAnnotation

func (d *DeploymentWrapper) RemoveAnnotation(status string)

RemoveAnnotation will delete specific status annotation

func (*DeploymentWrapper) SetReplicas

func (d *DeploymentWrapper) SetReplicas(replicas int32)

type EvictionAutoScalerReconciler

type EvictionAutoScalerReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

EvictionAutoScalerReconciler reconciles a EvictionAutoScaler object

func (*EvictionAutoScalerReconciler) Reconcile

func (*EvictionAutoScalerReconciler) SetupWithManager

func (r *EvictionAutoScalerReconciler) SetupWithManager(mgr ctrl.Manager) error

type NodeReconciler

type NodeReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

EvictionAutoScalerReconciler reconciles a EvictionAutoScaler object

func (*NodeReconciler) Reconcile

func (r *NodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is the main loop of the controller. It will look for unschedulded nodes and for every pod on the node

func (*NodeReconciler) SetupWithManager

func (r *NodeReconciler) SetupWithManager(mgr ctrl.Manager) error

type PDBToEvictionAutoScalerReconciler

type PDBToEvictionAutoScalerReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

PDBToEvictionAutoScalerReconciler reconciles a PodDisruptionBudget object.

func (*PDBToEvictionAutoScalerReconciler) Reconcile

Reconcile reads the state of the cluster for a PDB and creates/deletes EvictionAutoScalers accordingly.

func (*PDBToEvictionAutoScalerReconciler) SetupWithManager

func (r *PDBToEvictionAutoScalerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type StatefulSetWrapper

type StatefulSetWrapper struct {
	// contains filtered or unexported fields
}

func (*StatefulSetWrapper) AddAnnotation

func (s *StatefulSetWrapper) AddAnnotation(status, newReplicas string)

AddAnnotation will reset and add new annotation map every time this func is called

func (*StatefulSetWrapper) GetMaxSurge

func (s *StatefulSetWrapper) GetMaxSurge() intstr.IntOrString

func (*StatefulSetWrapper) GetReplicas

func (s *StatefulSetWrapper) GetReplicas() int32

func (*StatefulSetWrapper) Obj

func (s *StatefulSetWrapper) Obj() client.Object

func (*StatefulSetWrapper) RemoveAnnotation

func (s *StatefulSetWrapper) RemoveAnnotation(status string)

RemoveAnnotation will delete specific status annotation

func (*StatefulSetWrapper) SetReplicas

func (s *StatefulSetWrapper) SetReplicas(replicas int32)

type Surger

type Surger interface {
	//GetGeneration() int64
	GetReplicas() int32
	SetReplicas(int32)
	GetMaxSurge() intstr.IntOrString
	Obj() client.Object
	//Update(ctx context.Context, obj Object, opts ...UpdateOption) error
	AddAnnotation(string, string)
	RemoveAnnotation(string)
}

func GetSurger

func GetSurger(kind string) (Surger, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳