node

package
v0.0.0-...-977ec7f Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MemoryPressureThreshold        = 0.9                    // 90%
	DiskPressureThreshold          = 95                     // 95%
	DiskPressureMinFreeSize uint64 = 3 * 1024 * 1024 * 1024 // 3G

	DiskOutMinFreeSize  = 100 * 1024 * 1024 // 100MB
	DiskOutMinFreeInode = 1000              // 1000 inodes

)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseNode

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

type BaseNodeDependence

type BaseNodeDependence struct {
	Runtime         string
	Namespace       string
	Address         string
	CapacityManager *CapacityManager
}

type CapacityManager

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

func NewCapacityManager

func NewCapacityManager(runtime string, cfg *config.CapacityCfg, reservedResCfg *config.ReservedResourcesCfg, rootDir string, localCapacity bool) (*CapacityManager, error)

func (*CapacityManager) Allocatable

func (pa *CapacityManager) Allocatable() v1.ResourceList

func (*CapacityManager) Capacity

func (pa *CapacityManager) Capacity() v1.ResourceList

Capacity returns a resource list containing the capacity limits.

func (*CapacityManager) GetCgroupCPUPeriod

func (pa *CapacityManager) GetCgroupCPUPeriod() *uint64

func (*CapacityManager) GetCgroupCPUQuota

func (pa *CapacityManager) GetCgroupCPUQuota() *int64

func (*CapacityManager) GetCgroupMemoryLimit

func (pa *CapacityManager) GetCgroupMemoryLimit() *int64

type GenericNodeDependence

type GenericNodeDependence struct {
	BaseNodeDependence
	DiskPressurePath string
}

type GenericNodeProvider

type GenericNodeProvider struct {
	*BaseNode
	// contains filtered or unexported fields
}

func NewGenericNodeProvider

func NewGenericNodeProvider(dep *GenericNodeDependence) *GenericNodeProvider

func (*GenericNodeProvider) ConfigureNode

func (gnp *GenericNodeProvider) ConfigureNode(ctx context.Context, name string) *v1.Node

func (*GenericNodeProvider) Ping

func (gnp *GenericNodeProvider) Ping(ctx context.Context) error

func (*GenericNodeProvider) RefreshNodeStatus

func (gnp *GenericNodeProvider) RefreshNodeStatus(ctx context.Context, nodeStatus *v1.NodeStatus) bool

func (*GenericNodeProvider) SetStatusUpdateCallback

func (gnp *GenericNodeProvider) SetStatusUpdateCallback(ctx context.Context, f func(*v1.Node))

type K8sNodeDependence

type K8sNodeDependence struct {
	BaseNodeDependence
	BkClient    clientset.Interface
	BkNamespace string
}

type K8sNodeProvider

type K8sNodeProvider struct {
	*BaseNode
	// contains filtered or unexported fields
}

func NewK8sNodeProvider

func NewK8sNodeProvider(dep *K8sNodeDependence) *K8sNodeProvider

func (*K8sNodeProvider) ConfigureNode

func (knp *K8sNodeProvider) ConfigureNode(ctx context.Context, name string) *v1.Node

func (*K8sNodeProvider) Ping

func (knp *K8sNodeProvider) Ping(ctx context.Context) error

func (*K8sNodeProvider) RefreshNodeStatus

func (knp *K8sNodeProvider) RefreshNodeStatus(ctx context.Context, nodeStatus *v1.NodeStatus) bool

func (*K8sNodeProvider) SetStatusUpdateCallback

func (knp *K8sNodeProvider) SetStatusUpdateCallback(ctx context.Context, cb func(*v1.Node))

Jump to

Keyboard shortcuts

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