resourcemanager

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ResourceManagerLogger = log.New(os.Stdout, "[RESOURCE-MANAGER] ", log.Flags())

Custom logger

Functions

func DelegateJob

func DelegateJob(service *types.Service, event string, logger *log.Logger) error

DelegateJob sends the event to a service's replica

func StartReScheduler

func StartReScheduler(cfg *types.Config, back types.ServerlessBackend, kubeClientset kubernetes.Interface)

StartReScheduler starts the ReScheduler loop to check if there are pending pods exceeding the cfg.ReSchedulerThreshold every cfg.ReSchedulerInterval

func StartResourceManager

func StartResourceManager(rm ResourceManager, interval int)

StartResourceManager starts the ResourceManager loop to check cluster resources every cfg.ResourceManagerInterval

Types

type DelegatedEvent

type DelegatedEvent struct {
	StorageProviderID string `json:"storage_provider"`
	Event             string `json:"event"`
}

DelegatedEvent wraps the original input event by adding the storage provider ID

func WrapEvent

func WrapEvent(providerID string, event string) DelegatedEvent

WrapEvent wraps an event adding the storage_provider field (from the service's cluster_id)

type KubeResourceManager

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

KubeResourceManager struct to represent the Kubernetes resource manager

func (*KubeResourceManager) IsSchedulable

func (krm *KubeResourceManager) IsSchedulable(resources v1.ResourceRequirements) bool

IsSchedulable check if a Service's v1.ResourceRequirements can be scheduled in the cluster

func (*KubeResourceManager) UpdateResources

func (krm *KubeResourceManager) UpdateResources() error

UpdateResources update the available resources in the cluster

type ResourceManager

type ResourceManager interface {
	UpdateResources() error
	IsSchedulable(v1.ResourceRequirements) bool
}

ResourceManager interface to define cluster-level resource managers

func MakeResourceManager

func MakeResourceManager(cfg *types.Config, kubeClientset kubernetes.Interface) ResourceManager

MakeResourceManager returns a new ResourceManager if it is enabled in the config Apache's YuniKorn scheduler not supported yet

Jump to

Keyboard shortcuts

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