Documentation ¶
Index ¶
- type AllocatedUnit
- type BindingMap
- type ClusterInfo
- type ClusterNodeCache
- func (c *ClusterNodeCache) AddNodeCache(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeCache
- func (c *ClusterNodeCache) Assume(units []AllocatedUnit) (err error)
- func (c *ClusterNodeCache) GetNodeCache(nodeName string) *NodeCache
- func (c *ClusterNodeCache) GetNodeNameFromPV(pv *corev1.PersistentVolume) string
- func (c *ClusterNodeCache) SetNodeCache(nodeCache *NodeCache) *NodeCache
- func (c *ClusterNodeCache) UpdateNodeCache(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeCache
- type ExclusiveResource
- type NodeCache
- func (nc *NodeCache) AddLVM(pv *corev1.PersistentVolume) error
- func (nc *NodeCache) AddLocalDevice(pv *corev1.PersistentVolume) error
- func (nc *NodeCache) AddLocalMountPoint(pv *corev1.PersistentVolume) error
- func (nc *NodeCache) IsLocalPVExist(kind pkg.VolumeType, resourceName string) bool
- func (nc *NodeCache) RemoveLVM(pv *corev1.PersistentVolume) error
- func (nc *NodeCache) RemoveLocalDevice(pv *corev1.PersistentVolume) error
- func (nc *NodeCache) RemoveLocalMountPoint(pv *corev1.PersistentVolume) error
- func (nc *NodeCache) UpdateLVM(old, pv *corev1.PersistentVolume) error
- func (nc *NodeCache) UpdateNodeInfo(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeCache
- type NodeInfo
- type PodPvcMapping
- func (p *PodPvcMapping) DeletePod(podName string, pvcs []*corev1.PersistentVolumeClaim)
- func (p *PodPvcMapping) DeletePvc(pvc *corev1.PersistentVolumeClaim)
- func (p *PodPvcMapping) IsPodPvcReady(pvc *corev1.PersistentVolumeClaim) bool
- func (p *PodPvcMapping) PutPod(podName string, pvcs []*corev1.PersistentVolumeClaim)
- func (p *PodPvcMapping) PutPvc(pvc *corev1.PersistentVolumeClaim)
- type PvcStatusInfo
- type ResourceName
- type ResourceType
- type SharedResource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllocatedUnit ¶
type BindingMap ¶
type BindingMap map[string]*AllocatedUnit
pvc and binding info mapping
func (BindingMap) IsPVCExists ¶
func (bm BindingMap) IsPVCExists(pvc string) bool
type ClusterInfo ¶
type ClusterInfo struct { Nodes map[string]*NodeCache `json:"Nodes,omitempty"` // Only records the requested open-local unit to avoid duplicate scheduling request BindingInfo BindingMap `json:"bindingInfo,omitempty"` // PvcMapping records requested pod and pvc mapping PvcMapping *PodPvcMapping `json:"pvcMapping"` }
type ClusterNodeCache ¶
type ClusterNodeCache struct { ClusterInfo // contains filtered or unexported fields }
ClusterNodeCache maintains mapping of allocated local PVs and Nodes
func NewClusterNodeCache ¶
func NewClusterNodeCache() *ClusterNodeCache
func (*ClusterNodeCache) AddNodeCache ¶
func (c *ClusterNodeCache) AddNodeCache(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeCache
func (*ClusterNodeCache) Assume ¶
func (c *ClusterNodeCache) Assume(units []AllocatedUnit) (err error)
Assume updates the allocated units into cache immediately to avoid any potential resource over allocated
func (*ClusterNodeCache) GetNodeCache ¶
func (c *ClusterNodeCache) GetNodeCache(nodeName string) *NodeCache
func (*ClusterNodeCache) GetNodeNameFromPV ¶
func (c *ClusterNodeCache) GetNodeNameFromPV(pv *corev1.PersistentVolume) string
func (*ClusterNodeCache) SetNodeCache ¶
func (c *ClusterNodeCache) SetNodeCache(nodeCache *NodeCache) *NodeCache
func (*ClusterNodeCache) UpdateNodeCache ¶
func (c *ClusterNodeCache) UpdateNodeCache(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeCache
type ExclusiveResource ¶
type NodeCache ¶
type NodeCache struct { NodeInfo // contains filtered or unexported fields }
func NewNodeCache ¶
func NewNodeCacheFromStorage ¶
func NewNodeCacheFromStorage(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeCache
func (*NodeCache) AddLVM ¶
func (nc *NodeCache) AddLVM(pv *corev1.PersistentVolume) error
AddLVM add lvm PV to cache note: this function does not handle pv update event
func (*NodeCache) AddLocalDevice ¶
func (nc *NodeCache) AddLocalDevice(pv *corev1.PersistentVolume) error
func (*NodeCache) AddLocalMountPoint ¶
func (nc *NodeCache) AddLocalMountPoint(pv *corev1.PersistentVolume) error
func (*NodeCache) IsLocalPVExist ¶ added in v0.2.2
func (nc *NodeCache) IsLocalPVExist(kind pkg.VolumeType, resourceName string) bool
IsLocalPVExist will check whether PV exists in LocalPV according to resourceName and kind
func (*NodeCache) RemoveLocalDevice ¶
func (nc *NodeCache) RemoveLocalDevice(pv *corev1.PersistentVolume) error
func (*NodeCache) RemoveLocalMountPoint ¶
func (nc *NodeCache) RemoveLocalMountPoint(pv *corev1.PersistentVolume) error
func (*NodeCache) UpdateLVM ¶
func (nc *NodeCache) UpdateLVM(old, pv *corev1.PersistentVolume) error
UpdateLVM updates lvm PV to cache note: this function does not handle pv add event
func (*NodeCache) UpdateNodeInfo ¶
func (nc *NodeCache) UpdateNodeInfo(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeCache
type NodeInfo ¶
type NodeInfo struct { NodeName string // VGs is the volume group VGs map[ResourceName]SharedResource MountPoints map[ResourceName]ExclusiveResource // Devices only contains the whitelist raw devices Devices map[ResourceName]ExclusiveResource AllocatedNum int64 LocalPVs map[string]corev1.PersistentVolume }
type PodPvcMapping ¶
type PodPvcMapping struct { // PodPvcStatus count ref for a specified pod // string => pod namespace/name // PvcStatus => pvc status // podName <=> pvcStatusInfo PodPvcInfo map[string]PvcStatusInfo // store the pvc to pod mapping for faster index by pvc // pvcName <=> podName PvcPod map[string]string }
func NewPodPvcMapping ¶
func NewPodPvcMapping() *PodPvcMapping
func (*PodPvcMapping) DeletePod ¶
func (p *PodPvcMapping) DeletePod(podName string, pvcs []*corev1.PersistentVolumeClaim)
DeletePod deletes pod and all its pvcs for cache
func (*PodPvcMapping) DeletePvc ¶
func (p *PodPvcMapping) DeletePvc(pvc *corev1.PersistentVolumeClaim)
DeletePvc deletes pvc key from change
func (*PodPvcMapping) IsPodPvcReady ¶
func (p *PodPvcMapping) IsPodPvcReady(pvc *corev1.PersistentVolumeClaim) bool
IsPodPvcReady defines whether a pvc and its related pvcs are ready(with selected node) for pv provisioning; it returns true only when all pvcs of a pod are marked as ready for provisioning.
func (*PodPvcMapping) PutPod ¶
func (p *PodPvcMapping) PutPod(podName string, pvcs []*corev1.PersistentVolumeClaim)
PutPod adds or updates the pod and pvc mapping it assures they are open-local type and contain all the requested PVCs
func (*PodPvcMapping) PutPvc ¶
func (p *PodPvcMapping) PutPvc(pvc *corev1.PersistentVolumeClaim)
PutPvc adds or updates the pod and pvc mapping it assure the pvcs contains all the requested PVCs
type PvcStatusInfo ¶
PvcStatus refers to the pvc(for a pod) and its status of selected node string => pvc namespace/name bool => true/false true means volume.kubernetes.io/selected-node
func NewPvcStatusInfo ¶
func NewPvcStatusInfo() PvcStatusInfo
type ResourceName ¶
type ResourceName string
type ResourceType ¶
type ResourceType string
const ( ExclusiveResourceType ResourceType = "Exclusive" )
type SharedResource ¶
type SharedResource struct {}