cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupIndexes

func SetupIndexes(indexer client.FieldIndexer) error

Types

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Cache keeps track of the Workloads that got admitted through ClusterQueues.

func New

func New(client client.Client) *Cache

func (*Cache) AddClusterQueue

func (c *Cache) AddClusterQueue(ctx context.Context, cq *kueue.ClusterQueue) error

func (*Cache) AddOrUpdateResourceFlavor

func (c *Cache) AddOrUpdateResourceFlavor(rf *kueue.ResourceFlavor)

func (*Cache) AddOrUpdateWorkload

func (c *Cache) AddOrUpdateWorkload(w *kueue.Workload) bool

func (*Cache) AssumeWorkload

func (c *Cache) AssumeWorkload(w *kueue.Workload) error

func (*Cache) DeleteClusterQueue

func (c *Cache) DeleteClusterQueue(cq *kueue.ClusterQueue)

func (*Cache) DeleteResourceFlavor

func (c *Cache) DeleteResourceFlavor(rf *kueue.ResourceFlavor)

func (*Cache) DeleteWorkload

func (c *Cache) DeleteWorkload(w *kueue.Workload) error

func (*Cache) ForgetWorkload

func (c *Cache) ForgetWorkload(w *kueue.Workload) error

func (*Cache) Snapshot

func (c *Cache) Snapshot() Snapshot

func (*Cache) UpdateClusterQueue

func (c *Cache) UpdateClusterQueue(cq *kueue.ClusterQueue) error

func (*Cache) UpdateWorkload

func (c *Cache) UpdateWorkload(oldWl, newWl *kueue.Workload) error

func (*Cache) Usage

func (c *Cache) Usage(cqObj *kueue.ClusterQueue) (kueue.UsedResources, int, error)

Usage reports the used resources and number of workloads admitted by the ClusterQueue.

type ClusterQueue

type ClusterQueue struct {
	Name                 string
	Cohort               *Cohort
	RequestableResources map[corev1.ResourceName][]FlavorLimits
	UsedResources        Resources
	Workloads            map[string]*workload.Info
	NamespaceSelector    labels.Selector
	// The set of key labels from all flavors of a resource.
	// Those keys define the affinity terms of a workload
	// that can be matched against the flavors.
	LabelKeys map[corev1.ResourceName]sets.String
}

ClusterQueue is the internal implementation of kueue.ClusterQueue that holds admitted workloads.

func (*ClusterQueue) UpdateLabelKeys

func (c *ClusterQueue) UpdateLabelKeys(flavors map[string]*kueue.ResourceFlavor)

UpdateLabelKeys updates a ClusterQueue's LabelKeys based on the passed ResourceFlavors set. Exported only for testing.

type Cohort

type Cohort struct {
	Name string

	// These fields are only populated for a snapshot.
	RequestableResources Resources
	UsedResources        Resources
	// contains filtered or unexported fields
}

Cohort is a set of ClusterQueues that can borrow resources from each other.

type FlavorLimits

type FlavorLimits struct {
	Name string
	Min  int64
	Max  *int64
}

FlavorLimits holds a processed ClusterQueue flavor quota.

type Resources

type Resources map[corev1.ResourceName]map[string]int64

type Snapshot

type Snapshot struct {
	ClusterQueues   map[string]*ClusterQueue
	ResourceFlavors map[string]*kueue.ResourceFlavor
}

Jump to

Keyboard shortcuts

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