Documentation ¶
Overview ¶
Copyright 2022/9/8 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/8/17 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/8/17 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/9/9 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/9/9 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/9/9 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/9/9 Alibaba Cloud. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/9/13 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/8/28 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022/8/17 Alibaba Cloud.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func NewDevicePVAllocator(cache *NodeStorageAllocatedCache) *devicePVAllocator
- func NewInlineVolumeAllocator(cache *NodeStorageAllocatedCache) *inlineVolumeAllocator
- func NewLVMSnapshotPVAllocator(cache *NodeStorageAllocatedCache) *lvmSnapshotPVAllocator
- func NewVGScheduleBinpackStrategy() *vgScheduleBinpackStrategy
- func NewVGScheduleSpreadStrategy() *vgScheduleSpreadStrategy
- type BasePVAllocated
- type DeviceHandler
- type DevicePVCInfo
- type DevicePVCInfos
- type DeviceResourcePool
- type DeviceScheduleBinpackStrategy
- type DeviceScheduleSpreadStrategy
- type DeviceScheduleStrategy
- type DeviceStates
- type DeviceTypePVAllocated
- type InlineVolumeAllocated
- type InlineVolumeAllocator
- type InlineVolumeEventAllocator
- type InlineVolumeScheduleAllocator
- type InlineVolumes
- type LVMCommonPVCInfos
- type LVMPVAllocated
- type LVMPVCInfo
- type LVMSnapshotPVCInfos
- type NodeAllocateState
- type NodeAllocateUnits
- type NodeInlineVolumeAllocatedDetails
- type NodeStorageAllocatedCache
- func (c *NodeStorageAllocatedCache) AddNodeStorage(nodeLocal *nodelocalstorage.NodeLocalStorage)
- func (c *NodeStorageAllocatedCache) AddOrUpdatePV(pv *corev1.PersistentVolume, nodeName string)
- func (c *NodeStorageAllocatedCache) AddOrUpdatePVC(pvc *corev1.PersistentVolumeClaim, nodeName, volumeName string)
- func (c *NodeStorageAllocatedCache) AddPod(pod *corev1.Pod)
- func (c *NodeStorageAllocatedCache) DeletePV(pv *corev1.PersistentVolume, nodeName string)
- func (c *NodeStorageAllocatedCache) DeletePVC(pvc *corev1.PersistentVolumeClaim)
- func (c *NodeStorageAllocatedCache) DeletePod(pod *corev1.Pod)
- func (c *NodeStorageAllocatedCache) GetNodeStorageStateCopy(nodeName string) *NodeStorageState
- func (c *NodeStorageAllocatedCache) GetPVAllocatedDetailCopy(volumeName string) PVAllocated
- func (c *NodeStorageAllocatedCache) GetPVCAllocatedDetailCopy(pvcNameSpace, pvcName string) PVAllocated
- func (c *NodeStorageAllocatedCache) GetPodInlineVolumeDetailsCopy(nodeName, podUid string) *PodInlineVolumeAllocatedDetails
- func (c *NodeStorageAllocatedCache) IsLocalNode(nodeName string) bool
- func (c *NodeStorageAllocatedCache) IsPVHaveAllocateInfo(pv *corev1.PersistentVolume, volumeType pkg.VolumeType) bool
- func (c *NodeStorageAllocatedCache) MakeAllocateInfo(pvc *corev1.PersistentVolumeClaim) *pkg.PVCAllocateInfo
- func (c *NodeStorageAllocatedCache) PreAllocate(pod *corev1.Pod, podVolumeInfo *PodLocalVolumeInfo, reservationPod *corev1.Pod, ...) (*NodeAllocateState, error)
- func (c *NodeStorageAllocatedCache) PrefilterInlineVolumes(pod *corev1.Pod, podVolumeInfo *PodLocalVolumeInfo) error
- func (c *NodeStorageAllocatedCache) PrefilterPVC(scLister storagelisters.StorageClassLister, snapClient snapshot.Interface, ...) error
- func (c *NodeStorageAllocatedCache) Reserve(preAllocateState *NodeAllocateState, reservationPodUid string) error
- func (c *NodeStorageAllocatedCache) Unreserve(reservedAllocateState *NodeAllocateState, reservationPodUid string, ...)
- func (c *NodeStorageAllocatedCache) UpdateNodeStorage(old, new *nodelocalstorage.NodeLocalStorage)
- func (c *NodeStorageAllocatedCache) UpdatePod(pod *corev1.Pod)
- type NodeStorageState
- type PVAllocated
- type PVAllocatedDetails
- func (l *PVAllocatedDetails) AssumeAllocateSizeToPVDetail(volumeName string, allocateSize int64) bool
- func (l *PVAllocatedDetails) AssumeByPVC(newAllocated PVAllocated)
- func (l *PVAllocatedDetails) AssumeByPVEvent(newAllocated PVAllocated) bool
- func (l *PVAllocatedDetails) DeleteByPV(remove PVAllocated)
- func (l *PVAllocatedDetails) DeleteByPVC(pvcKey string)
- func (l *PVAllocatedDetails) GetByPV(volumeName string) PVAllocated
- func (l *PVAllocatedDetails) GetByPVC(pvcNamespace, pvcName string) PVAllocated
- type PVCInfo
- type PVCInfos
- type PVCScheduleAllocator
- type PVPVCAllocator
- type PVPVCEventAllocator
- type PodInlineVolumeAllocatedDetails
- type PodLocalVolumeInfo
- type VGHandler
- type VGScheduleStrategy
- type VGStates
- type VGStoragePool
Constants ¶
const ( VolumeTypePersistent = "Persistent" VolumeTypeEphemeral = "Ephemeral" PoolKindLVM = "LVM" )
Variables ¶
This section is empty.
Functions ¶
func NewDevicePVAllocator ¶
func NewDevicePVAllocator(cache *NodeStorageAllocatedCache) *devicePVAllocator
func NewInlineVolumeAllocator ¶
func NewInlineVolumeAllocator(cache *NodeStorageAllocatedCache) *inlineVolumeAllocator
func NewLVMSnapshotPVAllocator ¶
func NewLVMSnapshotPVAllocator(cache *NodeStorageAllocatedCache) *lvmSnapshotPVAllocator
func NewVGScheduleBinpackStrategy ¶
func NewVGScheduleBinpackStrategy() *vgScheduleBinpackStrategy
func NewVGScheduleSpreadStrategy ¶
func NewVGScheduleSpreadStrategy() *vgScheduleSpreadStrategy
Types ¶
type BasePVAllocated ¶
type BasePVAllocated struct { VolumeName string PVCName string PVCNamespace string NodeName string Requested int64 //requested size from pvc Allocated int64 //actual allocated size for the pvc }
PV Local allocated details
func (*BasePVAllocated) DeepCopy ¶
func (b *BasePVAllocated) DeepCopy() *BasePVAllocated
type DeviceHandler ¶
type DeviceHandler struct { }
func (*DeviceHandler) CreateStatesByNodeLocal ¶
func (h *DeviceHandler) CreateStatesByNodeLocal(nodeLocal *nodelocalstorage.NodeLocalStorage) map[string]*DeviceResourcePool
func (*DeviceHandler) StatesForUpdate ¶
func (h *DeviceHandler) StatesForUpdate(old, new map[string]*DeviceResourcePool) map[string]*DeviceResourcePool
type DevicePVCInfo ¶
type DevicePVCInfo struct { MediaType localtype.MediaType Request int64 PVC *corev1.PersistentVolumeClaim }
type DevicePVCInfos ¶
type DevicePVCInfos struct { SSDDevicePVCs []*DevicePVCInfo //local lvm PVC have vgName and had not allocated before HDDDevicePVCs []*DevicePVCInfo //local lvm PVC have no vgName and had not allocated before }
func NewDevicePVCInfos ¶
func NewDevicePVCInfos() *DevicePVCInfos
func (*DevicePVCInfos) HaveLocalVolumes ¶
func (info *DevicePVCInfos) HaveLocalVolumes() bool
type DeviceResourcePool ¶
type DeviceResourcePool struct { Name string Total int64 Allocatable int64 Requested int64 MediaType localtype.MediaType IsAllocated bool }
func NewDeviceResourcePoolForAllocate ¶
func NewDeviceResourcePoolForAllocate(deviceName string) *DeviceResourcePool
func NewDeviceResourcePoolFromDeviceInfo ¶
func NewDeviceResourcePoolFromDeviceInfo(device nodelocalstorage.DeviceInfo) *DeviceResourcePool
func (*DeviceResourcePool) DeepCopy ¶
func (d *DeviceResourcePool) DeepCopy() *DeviceResourcePool
func (*DeviceResourcePool) GetName ¶
func (d *DeviceResourcePool) GetName() string
func (*DeviceResourcePool) UpdateByNLS ¶
func (d *DeviceResourcePool) UpdateByNLS(new *DeviceResourcePool)
type DeviceScheduleBinpackStrategy ¶
type DeviceScheduleBinpackStrategy struct {
// contains filtered or unexported fields
}
func NewDeviceScheduleBinpackStrategy ¶
func NewDeviceScheduleBinpackStrategy() *DeviceScheduleBinpackStrategy
func NewDeviceScheduleSpreadStrategy ¶
func NewDeviceScheduleSpreadStrategy() *DeviceScheduleBinpackStrategy
func (*DeviceScheduleBinpackStrategy) ScoreByCount ¶
func (s *DeviceScheduleBinpackStrategy) ScoreByCount(nodeAllocate *NodeAllocateState) (score int64)
type DeviceScheduleSpreadStrategy ¶
type DeviceScheduleSpreadStrategy struct {
// contains filtered or unexported fields
}
func (*DeviceScheduleSpreadStrategy) ScoreByCount ¶
func (s *DeviceScheduleSpreadStrategy) ScoreByCount(nodeAllocate *NodeAllocateState) (score int64)
type DeviceScheduleStrategy ¶
type DeviceScheduleStrategy interface {
ScoreByCount(nodeAllocate *NodeAllocateState) (score int64)
}
func GetDeviceScheduleStrategy ¶
func GetDeviceScheduleStrategy(strategy pkg.StrategyType) DeviceScheduleStrategy
type DeviceStates ¶
type DeviceStates map[string]*DeviceResourcePool
func (DeviceStates) AllocateDevice ¶
func (s DeviceStates) AllocateDevice(deviceName string, requestSize int64)
func (DeviceStates) DeepCopy ¶
func (s DeviceStates) DeepCopy() DeviceStates
func (DeviceStates) RevertDevice ¶
func (s DeviceStates) RevertDevice(deviceName string)
type DeviceTypePVAllocated ¶
type DeviceTypePVAllocated struct { BasePVAllocated DeviceName string }
func NewDeviceTypePVAllocatedFromPV ¶
func NewDeviceTypePVAllocatedFromPV(pv *corev1.PersistentVolume, deviceName, nodeName string) *DeviceTypePVAllocated
func (*DeviceTypePVAllocated) DeepCopy ¶
func (device *DeviceTypePVAllocated) DeepCopy() PVAllocated
func (*DeviceTypePVAllocated) GetBasePVAllocated ¶
func (device *DeviceTypePVAllocated) GetBasePVAllocated() *BasePVAllocated
func (*DeviceTypePVAllocated) GetVolumeType ¶
func (device *DeviceTypePVAllocated) GetVolumeType() localtype.VolumeType
type InlineVolumeAllocated ¶
type InlineVolumeAllocated struct { VgName string `json:"vgName,string"` VolumeName string `json:"volumeName,string"` VolumeSize int64 `json:"volumeSize,string"` PodName string `json:"podName,string"` PodNamespace string `json:"podNamespace,string"` Allocated int64 // actual allocated size for the pvc }
InlineVolume allocated details
func CreateInlineVolumes ¶
func CreateInlineVolumes(podName, volumeName string, volumeSize int64) *InlineVolumeAllocated
func NewInlineVolumeAllocated ¶
func NewInlineVolumeAllocated(podName, podNameSpace, vgName, volumeName string, volumeSize int64) *InlineVolumeAllocated
func (*InlineVolumeAllocated) DeepCopy ¶
func (allocated *InlineVolumeAllocated) DeepCopy() *InlineVolumeAllocated
type InlineVolumeAllocator ¶
type InlineVolumeAllocator interface { InlineVolumeEventAllocator InlineVolumeScheduleAllocator }
type InlineVolumeEventAllocator ¶
type InlineVolumeEventAllocator interface {
// contains filtered or unexported methods
}
use by event handler
type InlineVolumeScheduleAllocator ¶
type InlineVolumeScheduleAllocator interface {
// contains filtered or unexported methods
}
type InlineVolumes ¶
type InlineVolumes []*InlineVolumeAllocated
func (*InlineVolumes) HaveLocalVolumes ¶
func (volumes *InlineVolumes) HaveLocalVolumes() bool
type LVMCommonPVCInfos ¶
type LVMCommonPVCInfos struct { LVMPVCsWithVgNameNotAllocated []*LVMPVCInfo //local lvm PVC have vgName and had not allocated before LVMPVCsWithoutVgNameNotAllocated []*LVMPVCInfo //local lvm PVC have no vgName and had not allocated before }
func NewLVMCommonPVCInfos ¶
func NewLVMCommonPVCInfos() *LVMCommonPVCInfos
func (*LVMCommonPVCInfos) HaveLocalVolumes ¶
func (info *LVMCommonPVCInfos) HaveLocalVolumes() bool
type LVMPVAllocated ¶
type LVMPVAllocated struct { BasePVAllocated VGName string }
func NewLVMPVAllocatedFromPV ¶
func NewLVMPVAllocatedFromPV(pv *corev1.PersistentVolume, vgName, nodeName string) *LVMPVAllocated
pv bounding status: have pvcName, other status may have no pvcName
func (*LVMPVAllocated) DeepCopy ¶
func (lvm *LVMPVAllocated) DeepCopy() PVAllocated
func (*LVMPVAllocated) GetBasePVAllocated ¶
func (lvm *LVMPVAllocated) GetBasePVAllocated() *BasePVAllocated
func (*LVMPVAllocated) GetVolumeType ¶
func (lvm *LVMPVAllocated) GetVolumeType() localtype.VolumeType
type LVMPVCInfo ¶
type LVMPVCInfo struct { VGName string Request int64 PVC *corev1.PersistentVolumeClaim }
* prefilter pvc infos for pod
type LVMSnapshotPVCInfos ¶
type LVMSnapshotPVCInfos []*LVMPVCInfo
func (*LVMSnapshotPVCInfos) HaveLocalVolumes ¶
func (info *LVMSnapshotPVCInfos) HaveLocalVolumes() bool
type NodeAllocateState ¶
type NodeAllocateState struct { NodeName string PodUid string Units *NodeAllocateUnits NodeStorageAllocatedByUnits *NodeStorageState }
type NodeAllocateUnits ¶
type NodeAllocateUnits struct { LVMPVCAllocateUnits []*LVMPVAllocated DevicePVCAllocateUnits []*DeviceTypePVAllocated InlineVolumeAllocateUnits []*InlineVolumeAllocated }
func (*NodeAllocateUnits) Clone ¶
func (units *NodeAllocateUnits) Clone() *NodeAllocateUnits
func (*NodeAllocateUnits) HaveLocalUnits ¶
func (units *NodeAllocateUnits) HaveLocalUnits() bool
func (*NodeAllocateUnits) ResetAllocatedSize ¶
func (units *NodeAllocateUnits) ResetAllocatedSize()
type NodeInlineVolumeAllocatedDetails ¶
type NodeInlineVolumeAllocatedDetails map[string]*PodInlineVolumeAllocatedDetails
func (NodeInlineVolumeAllocatedDetails) DeepCopy ¶
func (details NodeInlineVolumeAllocatedDetails) DeepCopy() NodeInlineVolumeAllocatedDetails
type NodeStorageAllocatedCache ¶
func CreateTestCache ¶
func CreateTestCache() *NodeStorageAllocatedCache
func NewNodeStorageAllocatedCache ¶
func NewNodeStorageAllocatedCache(strategyType pkg.StrategyType) *NodeStorageAllocatedCache
func (*NodeStorageAllocatedCache) AddNodeStorage ¶
func (c *NodeStorageAllocatedCache) AddNodeStorage(nodeLocal *nodelocalstorage.NodeLocalStorage)
func (*NodeStorageAllocatedCache) AddOrUpdatePV ¶
func (c *NodeStorageAllocatedCache) AddOrUpdatePV(pv *corev1.PersistentVolume, nodeName string)
func (*NodeStorageAllocatedCache) AddOrUpdatePVC ¶
func (c *NodeStorageAllocatedCache) AddOrUpdatePVC(pvc *corev1.PersistentVolumeClaim, nodeName, volumeName string)
func (*NodeStorageAllocatedCache) AddPod ¶
func (c *NodeStorageAllocatedCache) AddPod(pod *corev1.Pod)
func (*NodeStorageAllocatedCache) DeletePV ¶
func (c *NodeStorageAllocatedCache) DeletePV(pv *corev1.PersistentVolume, nodeName string)
func (*NodeStorageAllocatedCache) DeletePVC ¶
func (c *NodeStorageAllocatedCache) DeletePVC(pvc *corev1.PersistentVolumeClaim)
func (*NodeStorageAllocatedCache) DeletePod ¶
func (c *NodeStorageAllocatedCache) DeletePod(pod *corev1.Pod)
func (*NodeStorageAllocatedCache) GetNodeStorageStateCopy ¶
func (c *NodeStorageAllocatedCache) GetNodeStorageStateCopy(nodeName string) *NodeStorageState
func (*NodeStorageAllocatedCache) GetPVAllocatedDetailCopy ¶
func (c *NodeStorageAllocatedCache) GetPVAllocatedDetailCopy(volumeName string) PVAllocated
func (*NodeStorageAllocatedCache) GetPVCAllocatedDetailCopy ¶
func (c *NodeStorageAllocatedCache) GetPVCAllocatedDetailCopy(pvcNameSpace, pvcName string) PVAllocated
func (*NodeStorageAllocatedCache) GetPodInlineVolumeDetailsCopy ¶
func (c *NodeStorageAllocatedCache) GetPodInlineVolumeDetailsCopy(nodeName, podUid string) *PodInlineVolumeAllocatedDetails
func (*NodeStorageAllocatedCache) IsLocalNode ¶
func (c *NodeStorageAllocatedCache) IsLocalNode(nodeName string) bool
func (*NodeStorageAllocatedCache) IsPVHaveAllocateInfo ¶
func (c *NodeStorageAllocatedCache) IsPVHaveAllocateInfo(pv *corev1.PersistentVolume, volumeType pkg.VolumeType) bool
func (*NodeStorageAllocatedCache) MakeAllocateInfo ¶
func (c *NodeStorageAllocatedCache) MakeAllocateInfo(pvc *corev1.PersistentVolumeClaim) *pkg.PVCAllocateInfo
func (*NodeStorageAllocatedCache) PreAllocate ¶
func (c *NodeStorageAllocatedCache) PreAllocate(pod *corev1.Pod, podVolumeInfo *PodLocalVolumeInfo, reservationPod *corev1.Pod, nodeName string) (*NodeAllocateState, error)
func (*NodeStorageAllocatedCache) PrefilterInlineVolumes ¶
func (c *NodeStorageAllocatedCache) PrefilterInlineVolumes(pod *corev1.Pod, podVolumeInfo *PodLocalVolumeInfo) error
func (*NodeStorageAllocatedCache) PrefilterPVC ¶
func (c *NodeStorageAllocatedCache) PrefilterPVC(scLister storagelisters.StorageClassLister, snapClient snapshot.Interface, localPVC *corev1.PersistentVolumeClaim, podVolumeInfos *PodLocalVolumeInfo) error
func (*NodeStorageAllocatedCache) Reserve ¶
func (c *NodeStorageAllocatedCache) Reserve(preAllocateState *NodeAllocateState, reservationPodUid string) error
assume by cache, should record unit.allocated , allocated size will use by plugin Unreserve to revert cache
func (*NodeStorageAllocatedCache) Unreserve ¶
func (c *NodeStorageAllocatedCache) Unreserve(reservedAllocateState *NodeAllocateState, reservationPodUid string, reservationPodUnits []*InlineVolumeAllocated)
func (*NodeStorageAllocatedCache) UpdateNodeStorage ¶
func (c *NodeStorageAllocatedCache) UpdateNodeStorage(old, new *nodelocalstorage.NodeLocalStorage)
func (*NodeStorageAllocatedCache) UpdatePod ¶
func (c *NodeStorageAllocatedCache) UpdatePod(pod *corev1.Pod)
type NodeStorageState ¶
type NodeStorageState struct { VGStates VGStates DeviceStates DeviceStates InitedByNLS bool }
func NewNodeStorageState ¶
func NewNodeStorageState() *NodeStorageState
func NewNodeStorageStateFromStorage ¶
func NewNodeStorageStateFromStorage(nodeLocal *nodelocalstorage.NodeLocalStorage) *NodeStorageState
func (*NodeStorageState) DeepCopy ¶
func (n *NodeStorageState) DeepCopy() *NodeStorageState
func (*NodeStorageState) IsLocal ¶
func (n *NodeStorageState) IsLocal() bool
type PVAllocated ¶
type PVAllocated interface { GetBasePVAllocated() *BasePVAllocated GetVolumeType() localtype.VolumeType DeepCopy() PVAllocated }
type PVAllocatedDetails ¶
type PVAllocatedDetails struct {
// contains filtered or unexported fields
}
func NewPVAllocatedDetails ¶
func NewPVAllocatedDetails() *PVAllocatedDetails
func (*PVAllocatedDetails) AssumeAllocateSizeToPVDetail ¶
func (l *PVAllocatedDetails) AssumeAllocateSizeToPVDetail(volumeName string, allocateSize int64) bool
func (*PVAllocatedDetails) AssumeByPVC ¶
func (l *PVAllocatedDetails) AssumeByPVC(newAllocated PVAllocated)
func (*PVAllocatedDetails) AssumeByPVEvent ¶
func (l *PVAllocatedDetails) AssumeByPVEvent(newAllocated PVAllocated) bool
pvEvent must use this, may add pvcNameSpace/pvcName
func (*PVAllocatedDetails) DeleteByPV ¶
func (l *PVAllocatedDetails) DeleteByPV(remove PVAllocated)
func (*PVAllocatedDetails) DeleteByPVC ¶
func (l *PVAllocatedDetails) DeleteByPVC(pvcKey string)
func (*PVAllocatedDetails) GetByPV ¶
func (l *PVAllocatedDetails) GetByPV(volumeName string) PVAllocated
func (*PVAllocatedDetails) GetByPVC ¶
func (l *PVAllocatedDetails) GetByPVC(pvcNamespace, pvcName string) PVAllocated
type PVCInfo ¶
type PVCInfo struct { PVCNamespace string PVCName string VolumeName string NodeName string PVCStatus corev1.PersistentVolumeClaimPhase Requested int64 }
func NewPVCInfo ¶
func NewPVCInfo(pvc *corev1.PersistentVolumeClaim, nodeName, volumeName string) *PVCInfo
type PVCScheduleAllocator ¶
type PVCScheduleAllocator interface {
// contains filtered or unexported methods
}
user by scheduler
type PVPVCAllocator ¶
type PVPVCAllocator interface { PVPVCEventAllocator PVCScheduleAllocator }
func NewLVMCommonPVAllocator ¶
func NewLVMCommonPVAllocator(cache *NodeStorageAllocatedCache) PVPVCAllocator
type PVPVCEventAllocator ¶
type PVPVCEventAllocator interface {
// contains filtered or unexported methods
}
use by event handler
type PodInlineVolumeAllocatedDetails ¶
type PodInlineVolumeAllocatedDetails []*InlineVolumeAllocated
func (*PodInlineVolumeAllocatedDetails) DeepCopy ¶
func (details *PodInlineVolumeAllocatedDetails) DeepCopy() *PodInlineVolumeAllocatedDetails
type PodLocalVolumeInfo ¶
type PodLocalVolumeInfo struct { LVMPVCsNotROSnapshot *LVMCommonPVCInfos LVMPVCsROSnapshot LVMSnapshotPVCInfos DevicePVCs *DevicePVCInfos InlineVolumes InlineVolumes }
calculate at step preFilter to avoid duplicate calculating after
func NewPodLocalVolumeInfo ¶
func NewPodLocalVolumeInfo() *PodLocalVolumeInfo
func (*PodLocalVolumeInfo) HaveLocalVolumes ¶
func (info *PodLocalVolumeInfo) HaveLocalVolumes() bool
type VGHandler ¶
type VGHandler struct { }
func (*VGHandler) CreateStatesByNodeLocal ¶
func (h *VGHandler) CreateStatesByNodeLocal(nodeLocal *nodelocalstorage.NodeLocalStorage) map[string]*VGStoragePool
func (*VGHandler) StatesForUpdate ¶
func (h *VGHandler) StatesForUpdate(old, new map[string]*VGStoragePool) map[string]*VGStoragePool
type VGScheduleStrategy ¶
type VGScheduleStrategy interface { AllocateForPVCWithoutVgName(nodeName string, vgStates *[]*VGStoragePool, pvcInfo *LVMPVCInfo) (*LVMPVAllocated, error) ScoreByCapacity(nodeAllocate *NodeAllocateState) (score int64) }
func GetVGScheduleStrategy ¶
func GetVGScheduleStrategy(strategy pkg.StrategyType) VGScheduleStrategy
type VGStates ¶
type VGStates map[string]*VGStoragePool
VG support allocateType: LvmPV, InlineVolume
func (VGStates) GetVGStateList ¶
func (s VGStates) GetVGStateList() []*VGStoragePool
type VGStoragePool ¶
func NewVGState ¶
func NewVGState(vgName string) *VGStoragePool
func NewVGStateFromVGInfo ¶
func NewVGStateFromVGInfo(vgInfo nodelocalstorage.VolumeGroup) *VGStoragePool
func (*VGStoragePool) DeepCopy ¶
func (vg *VGStoragePool) DeepCopy() *VGStoragePool
func (*VGStoragePool) GetName ¶
func (vg *VGStoragePool) GetName() string
func (*VGStoragePool) UpdateByNLS ¶
func (vg *VGStoragePool) UpdateByNLS(new *VGStoragePool)