reconciler

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoneFilterCondition = ""
	NoneFilterName      = "none"
)
View Source
const (
	PodQOSFilterName = "podQOS"
)

Variables

This section is empty.

Functions

func NoneFilter added in v1.1.0

func NoneFilter() *noneFilter

NoneFilter returns a Filter which skip filtering anything (into the same condition)

func PodQOSFilter added in v1.1.0

func PodQOSFilter() *podQOSFilter

PodQOSFilter returns a Filter which filters pod qos class

func RegisterCgroupReconciler

func RegisterCgroupReconciler(level ReconcilerLevel, cgroupFile system.Resource, description string,
	fn reconcileFunc, filter Filter, conditions ...string)

RegisterCgroupReconciler registers a cgroup reconciler according to the cgroup file, reconcile function and filter conditions. A cgroup file of one level can have multiple reconcile functions with different filtered conditions.

e.g. pod-level cfs_quota can be registered both by cpuset hook and batchresource hook. While cpuset hook reconciles
cfs_quota for LSE and LSR pods, batchresource reconciles pods of BE QoS.

TODO: support priority+qos filter.

func RegisterHostAppReconciler added in v1.4.0

func RegisterHostAppReconciler(resource system.Resource, description string, fn reconcileFunc, opt *ReconcilerOption)

Types

type Context added in v1.4.0

type Context struct {
	StatesInformer    statesinformer.StatesInformer
	Executor          resourceexecutor.ResourceUpdateExecutor
	ReconcileInterval time.Duration
}

type Filter added in v1.1.0

type Filter interface {
	Name() string
	Filter(podMeta *statesinformer.PodMeta) string
}

Filter & Conditions: 1. a condition for one cgroup file should have no more than one filter/index func 2. different indexes of one cgroup file can have different reconcile functions 3. indexes for one cgroup should be enumerable

type Reconciler

type Reconciler interface {
	Run(stopCh <-chan struct{}) error
}

func NewHostAppReconciler added in v1.4.0

func NewHostAppReconciler(ctx Context) Reconciler

func NewReconciler

func NewReconciler(ctx Context) Reconciler

type ReconcilerLevel

type ReconcilerLevel string
const (
	KubeQOSLevel   ReconcilerLevel = "kubeqos"
	PodLevel       ReconcilerLevel = "pod"
	ContainerLevel ReconcilerLevel = "container"
	SandboxLevel   ReconcilerLevel = "sandbox"
)

type ReconcilerOption added in v1.4.0

type ReconcilerOption struct {
}

Jump to

Keyboard shortcuts

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