store

package
v0.0.0-...-7df4f84 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicSnapshotStore

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

BasicSnapshotStore is simple, reference implementation of ClusterSnapshotStore. It is inefficient. But hopefully bug-free and good for initial testing.

func NewBasicSnapshotStore

func NewBasicSnapshotStore() *BasicSnapshotStore

NewBasicSnapshotStore creates instances of BasicSnapshotStore.

func (*BasicSnapshotStore) AddSchedulerNodeInfo

func (snapshot *BasicSnapshotStore) AddSchedulerNodeInfo(nodeInfo *schedulerframework.NodeInfo) error

AddSchedulerNodeInfo adds a NodeInfo.

func (*BasicSnapshotStore) Commit

func (snapshot *BasicSnapshotStore) Commit() error

Commit commits changes done after forking.

func (*BasicSnapshotStore) DeviceClasses

func (snapshot *BasicSnapshotStore) DeviceClasses() schedulerframework.DeviceClassLister

DeviceClasses exposes the snapshot as DeviceClassLister.

func (*BasicSnapshotStore) DraSnapshot

func (snapshot *BasicSnapshotStore) DraSnapshot() drasnapshot.Snapshot

DraSnapshot returns the DRA snapshot.

func (*BasicSnapshotStore) ForceAddPod

func (snapshot *BasicSnapshotStore) ForceAddPod(pod *apiv1.Pod, nodeName string) error

ForceAddPod adds pod to the snapshot and schedules it to given node.

func (*BasicSnapshotStore) ForceRemovePod

func (snapshot *BasicSnapshotStore) ForceRemovePod(namespace, podName, nodeName string) error

ForceRemovePod removes pod from the snapshot.

func (*BasicSnapshotStore) Fork

func (snapshot *BasicSnapshotStore) Fork()

Fork creates a fork of snapshot state. All modifications can later be reverted to moment of forking via Revert()

func (*BasicSnapshotStore) IsPVCUsedByPods

func (snapshot *BasicSnapshotStore) IsPVCUsedByPods(key string) bool

IsPVCUsedByPods returns if the pvc is used by any pod

func (*BasicSnapshotStore) NodeInfos

NodeInfos exposes snapshot as NodeInfoLister.

func (*BasicSnapshotStore) RemoveSchedulerNodeInfo

func (snapshot *BasicSnapshotStore) RemoveSchedulerNodeInfo(nodeName string) error

RemoveSchedulerNodeInfo removes nodes (and pods scheduled to it) from the snapshot.

func (*BasicSnapshotStore) ResourceClaims

func (snapshot *BasicSnapshotStore) ResourceClaims() schedulerframework.ResourceClaimTracker

ResourceClaims exposes snapshot as ResourceClaimTracker

func (*BasicSnapshotStore) ResourceSlices

func (snapshot *BasicSnapshotStore) ResourceSlices() schedulerframework.ResourceSliceLister

ResourceSlices exposes snapshot as ResourceSliceLister.

func (*BasicSnapshotStore) Revert

func (snapshot *BasicSnapshotStore) Revert()

Revert reverts snapshot state to moment of forking.

func (*BasicSnapshotStore) SetClusterState

func (snapshot *BasicSnapshotStore) SetClusterState(nodes []*apiv1.Node, scheduledPods []*apiv1.Pod, draSnapshot drasnapshot.Snapshot) error

SetClusterState sets the cluster state.

func (*BasicSnapshotStore) StorageInfos

func (snapshot *BasicSnapshotStore) StorageInfos() schedulerframework.StorageInfoLister

StorageInfos exposes snapshot as StorageInfoLister.

type DeltaSnapshotStore

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

DeltaSnapshotStore is an implementation of ClusterSnapshotStore optimized for typical Cluster Autoscaler usage - (fork, add stuff, revert), repeated many times per loop.

Complexity of some notable operations:

fork - O(1)
revert - O(1)
commit - O(n)
list all pods (no filtering) - O(n), cached
list all pods (with filtering) - O(n)
list node infos - O(n), cached

Watch out for:

node deletions, pod additions & deletions - invalidates cache of current snapshot
	(when forked affects delta, but not base.)
pod affinity - causes scheduler framework to list pods with non-empty selector,
	so basic caching doesn't help.

func NewDeltaSnapshotStore

func NewDeltaSnapshotStore() *DeltaSnapshotStore

NewDeltaSnapshotStore creates instances of DeltaSnapshotStore.

func (*DeltaSnapshotStore) AddSchedulerNodeInfo

func (snapshot *DeltaSnapshotStore) AddSchedulerNodeInfo(nodeInfo *schedulerframework.NodeInfo) error

AddSchedulerNodeInfo adds a NodeInfo.

func (*DeltaSnapshotStore) Commit

func (snapshot *DeltaSnapshotStore) Commit() error

Commit commits changes done after forking. Time: O(n), where n = size of delta (number of nodes added, modified or deleted since forking)

func (*DeltaSnapshotStore) DeviceClasses

func (snapshot *DeltaSnapshotStore) DeviceClasses() schedulerframework.DeviceClassLister

DeviceClasses exposes the snapshot as DeviceClassLister.

func (*DeltaSnapshotStore) DraSnapshot

func (snapshot *DeltaSnapshotStore) DraSnapshot() drasnapshot.Snapshot

DraSnapshot returns the DRA snapshot.

func (*DeltaSnapshotStore) ForceAddPod

func (snapshot *DeltaSnapshotStore) ForceAddPod(pod *apiv1.Pod, nodeName string) error

ForceAddPod adds pod to the snapshot and schedules it to given node.

func (*DeltaSnapshotStore) ForceRemovePod

func (snapshot *DeltaSnapshotStore) ForceRemovePod(namespace, podName, nodeName string) error

ForceRemovePod removes pod from the snapshot.

func (*DeltaSnapshotStore) Fork

func (snapshot *DeltaSnapshotStore) Fork()

Fork creates a fork of snapshot state. All modifications can later be reverted to moment of forking via Revert() Time: O(1)

func (*DeltaSnapshotStore) IsPVCUsedByPods

func (snapshot *DeltaSnapshotStore) IsPVCUsedByPods(key string) bool

IsPVCUsedByPods returns if the pvc is used by any pod

func (*DeltaSnapshotStore) NodeInfos

NodeInfos returns node lister.

func (*DeltaSnapshotStore) RemoveSchedulerNodeInfo

func (snapshot *DeltaSnapshotStore) RemoveSchedulerNodeInfo(nodeName string) error

RemoveSchedulerNodeInfo removes nodes (and pods scheduled to it) from the snapshot.

func (*DeltaSnapshotStore) ResourceClaims

func (snapshot *DeltaSnapshotStore) ResourceClaims() schedulerframework.ResourceClaimTracker

ResourceClaims exposes snapshot as ResourceClaimTracker

func (*DeltaSnapshotStore) ResourceSlices

func (snapshot *DeltaSnapshotStore) ResourceSlices() schedulerframework.ResourceSliceLister

ResourceSlices exposes snapshot as ResourceSliceLister.

func (*DeltaSnapshotStore) Revert

func (snapshot *DeltaSnapshotStore) Revert()

Revert reverts snapshot state to moment of forking. Time: O(1)

func (*DeltaSnapshotStore) SetClusterState

func (snapshot *DeltaSnapshotStore) SetClusterState(nodes []*apiv1.Node, scheduledPods []*apiv1.Pod, draSnapshot drasnapshot.Snapshot) error

SetClusterState sets the cluster state.

func (*DeltaSnapshotStore) StorageInfos

func (snapshot *DeltaSnapshotStore) StorageInfos() schedulerframework.StorageInfoLister

StorageInfos returns storage lister

Jump to

Keyboard shortcuts

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