tide

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AnnotationNodePoolUpdate = labelPrefix + "/" + "update"

	LabelPodTypeKey     = labelPrefix + "/" + "pod-type"
	LabelOnlinePodValue = "online"

	LabelNodePoolKey = labelPrefix + "/" + "node-pool"

	LabelNodeTypeKey      = labelPrefix + "/" + "node-type"
	LabelOnlineNodeValue  = "online"
	LabelOfflineNodeValue = "offline"
	LabelTideNode         = labelPrefix + "/" + "tide"
	LabelReserveNode      = labelPrefix + "/" + "reserve"

	TaintEvictOnlinePodKey  = labelPrefix + "/" + "online-not-used"
	TaintEvictOfflinePodKey = labelPrefix + "/" + "offline-not-used"

	// NodePoolFinalizer is the finalizer name for LogRule operator
	NodePoolFinalizer = labelPrefix + "/" + "finalizer"
)

Functions

This section is empty.

Types

type NodeInfo

type NodeInfo struct {
	NodeUsage
}

type NodePoolWrapper

type NodePoolWrapper interface {
	GetOnlineReserveNodeSelector() labels.Selector
	GetOfflineReserveNodeSelector() labels.Selector
	GetOnlineTideNodeSelector() labels.Selector
	GetOfflineTideNodeSelector() labels.Selector
	GetTideNodeSelector() labels.Selector
	GetNodePoolSelector() *labels.Requirement

	SetNodeToOnlineReserve(node *corev1.Node)
	SetNodeToOfflineReserve(node *corev1.Node)
	SetNodeToTide(node *corev1.Node)
	SetNodeToTideOnline(node *corev1.Node)

	GetEvictOnlinePodTaint() apis.TaintOption
	GetEvictOfflinePodTaint() apis.TaintOption
	GetOnlineLabel() apis.LabelOption
	GetOfflineLabel() apis.LabelOption
	GetTideLabel() apis.LabelOption
	GetNodeSelector() map[string]string

	metav1.Object
}

func NewNodePoolWrapper

func NewNodePoolWrapper(nodePool *apis.TideNodePool) NodePoolWrapper

type NodeUsage

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

NodeUsage stores a node's info, pods on it, thresholds and its resource usage

type OnlinePodChecker

type OnlinePodChecker func(pod *corev1.Pod) bool

type Tide

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

func (*Tide) GetNodePoolInfo

func (t *Tide) GetNodePoolInfo(nodes []*corev1.Node, onlinePodChecker OnlinePodChecker) (simulator.ClusterSnapshot, []*corev1.Pod, error)

func (*Tide) Reconcile

func (t *Tide) Reconcile(ctx context.Context, tideNodePool *apis.TideNodePool) error

func (*Tide) Run

func (t *Tide) Run()

func (*Tide) RunOnce

func (t *Tide) RunOnce(ctx context.Context, onlinePodChecker OnlinePodChecker, tideNodePool NodePoolWrapper) error

func (*Tide) UpdateStatusByNodes

func (t *Tide) UpdateStatusByNodes(ctx context.Context, tideNodePool *apis.TideNodePool, reserveOnlineNodes, reserveOfflineNodes, tideNodes []*corev1.Node) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL