cache

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 13 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) AddLocalQueue added in v0.2.0

func (c *Cache) AddLocalQueue(q *kueue.LocalQueue) error

func (*Cache) AddOrUpdateResourceFlavor

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

func (*Cache) AddOrUpdateWorkload

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

func (*Cache) AssumeWorkload

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

func (*Cache) ClusterQueueActive added in v0.2.0

func (c *Cache) ClusterQueueActive(name string) bool

func (*Cache) ClusterQueueEmpty added in v0.2.0

func (c *Cache) ClusterQueueEmpty(name string) bool

ClusterQueueEmpty indicates whether there's any active workload admitted by the provided clusterQueue. Return true if the clusterQueue doesn't exist.

func (*Cache) ClusterQueueTerminating added in v0.2.0

func (c *Cache) ClusterQueueTerminating(name string) bool

func (*Cache) DeleteClusterQueue

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

func (*Cache) DeleteLocalQueue added in v0.2.0

func (c *Cache) DeleteLocalQueue(q *kueue.LocalQueue)

func (*Cache) DeleteResourceFlavor

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

func (*Cache) DeleteWorkload

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

func (*Cache) FlavorInUse added in v0.2.0

func (c *Cache) FlavorInUse(flavor string) (string, bool)

func (*Cache) ForgetWorkload

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

func (*Cache) MatchingClusterQueues added in v0.2.0

func (c *Cache) MatchingClusterQueues(nsLabels map[string]string) sets.String

func (*Cache) Snapshot

func (c *Cache) Snapshot() Snapshot

func (*Cache) TerminateClusterQueue added in v0.2.0

func (c *Cache) TerminateClusterQueue(name string)

func (*Cache) UpdateClusterQueue

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

func (*Cache) UpdateLocalQueue added in v0.2.0

func (c *Cache) UpdateLocalQueue(oldQ, newQ *kueue.LocalQueue) 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]*Resource
	UsedResources        ResourceQuantities
	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
	Status    metrics.ClusterQueueStatus
	// contains filtered or unexported fields
}

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

func (*ClusterQueue) Active added in v0.2.0

func (c *ClusterQueue) Active() bool

func (*ClusterQueue) UpdateCodependentResources added in v0.2.0

func (c *ClusterQueue) UpdateCodependentResources()

func (*ClusterQueue) UpdateWithFlavors added in v0.2.0

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

UpdateWithFlavors updates a ClusterQueue 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 ResourceQuantities
	UsedResources        ResourceQuantities
	// 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 Resource added in v0.2.0

type Resource struct {
	CodependentResources sets.String
	Flavors              []FlavorLimits
}

type ResourceQuantities added in v0.2.0

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

type Snapshot

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

Jump to

Keyboard shortcuts

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