controller

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2025 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpareTaintKey                    = "node.cybozu.io/spare"
	SpareRoleLabelKey                = "node-role.kubernetes.io/spare"
	NodeTemplateReferenceLabelKey    = "nyallocator.cybozu.io/node-template"
	OutOfManagementNodesLabelKey     = "nyallocator.cybozu.io/out-of-management"
	OutOfManagementNodesRoleLabelKey = "node-role.kubernetes.io/out-of-management"
	ZoneLabelKey                     = "topology.kubernetes.io/zone"
	NodeTemplateFinalizer            = "nyallocator.cybozu.io/finalizer"
	ConditionSufficient              = "Sufficient"
	ConditionReconcileSuccess        = "ReconcileSuccess"
)

Variables

View Source
var (
	CurrentNodesVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: metricsNamespace,
		Name:      "current_nodes",
		Help:      "Number of nodes under the NodeTemplate",
	}, []string{"nodetemplate"})
	DesiredNodesVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: metricsNamespace,
		Name:      "desired_nodes",
		Help:      "Number of nodes specified in the NodeTemplate",
	}, []string{"nodetemplate"})
	SpareNodesVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: metricsNamespace,
		Name:      "spare_nodes",
		Help:      "Number of spare nodes matching the NodeTemplate",
	}, []string{"nodetemplate"})
	SufficientNodesVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: metricsNamespace,
		Name:      "sufficient_nodes",
		Help:      "Whether number of nodes under the NodeTemplate is sufficient or not",
	}, []string{"nodetemplate"})
	ReconcileSuccessVec = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: metricsNamespace,
		Name:      "reconcile_success",
		Help:      "Whether reconciliations of the NodeTemplate is successful or not",
	}, []string{"nodetemplate"})
)

Functions

This section is empty.

Types

type InsufficientReason

type InsufficientReason struct {
	HighPriorityNodeTemplateExists bool
	NoSpareNodesFound              bool
}

type NodeReconciler

type NodeReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

func (*NodeReconciler) Reconcile

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

func (*NodeReconciler) SetupWithManager

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

type NodeTemplateReconciler

type NodeTemplateReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	RequeueRateLimiter workqueue.TypedRateLimiter[ctrl.Request]
}

func (*NodeTemplateReconciler) Reconcile

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

func (*NodeTemplateReconciler) SetupWithManager

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