Documentation ¶
Index ¶
- Constants
- func CheckVolumeInNode(vgName string, volumeid string) bool
- func CreateVolume(ctx context.Context, volumeID, vgName, lvmType string, poolname string) error
- func DeleteHostpathVolume(ctx context.Context, volID string) error
- func DeleteSnap(ctx context.Context, snapid string) error
- func FormatFSForDevice(devicePath, fstype string) error
- func FsCheck(devicePath string) (string, error)
- func GetAllLThinsVGS() map[string]string
- func GetAllLvms() []string
- func GetDevicePathForVolumue(ctx context.Context, volumeID string) (string, string, string, string, error)
- func GetFreeForLVM(vgName string) (string, error)
- func GetNodeAddress(ctx context.Context, volumeID string) (string, error)
- func GetNodeName() string
- func GetPV(ctx context.Context, volumeID string) *v1.PersistentVolume
- func GetPvSize(ctx context.Context, volumeID string) (int64, string)
- func GetS3ENSForSnapID(ctx context.Context, snapid string) (string, error)
- func GetS3ENV(ctx context.Context, name string, namespace string, s3endpoint string) (string, error)
- func GetSizeForPool(size string) int64
- func GetSnap(ctx context.Context, snapid string) (string, error)
- func GetTotalForLVM(vgName string) (string, error)
- func GetVgnameForVolume(ctx context.Context, volumeID string) (string, string, error)
- func GetVolContentsource(ctx context.Context, volumeID string) (snapid string, s3env string, err error)
- func GetpvnumberForVG(vgName string) (int, error)
- func LoadFromSnapshot(ctx context.Context, snapshotId, devicePath, mountpath string, s3env string) error
- func MirrorDevicetoS3(ctx context.Context, targetPath string, snapid string, s3env string) error
- func MirrorS3toDevice(ctx context.Context, targetPath string, snapid string, s3env string) error
- func MountVolforDevice(ctx context.Context, devicepath, targetPath string, fs string) error
- func MountVolforDeviceForSnap(ctx context.Context, devicepath, targetPath string, fs string) error
- func Runcmd(cmd string) (string, error)
- func SetNodeAddressForPV(ctx context.Context, node string, volumeID string) error
- func SetNodeId(id string)
- func UpdateNode(nodename string, lablename string, add bool, updatesize int64) error
- func UpdateNodeLab(nodeobj *v1.Node, lablename string, lablevalue string) bool
- func UpdateThinForNode() error
- func Updatenodeslabs() error
Constants ¶
View Source
const ( // NsenterCmd is the nsenter command NsenterCmd = "nsenter --mount=/proc/1/ns/mnt" // LinearType linear type LinearType = "linear" // StripingType striping type StripingType = "striping" )
Variables ¶
This section is empty.
Functions ¶
func CheckVolumeInNode ¶
func CreateVolume ¶
create lvm volume
func DeleteHostpathVolume ¶
deleteVolume deletes the directory for the hostpath volume.
func FormatFSForDevice ¶
func GetAllLThinsVGS ¶
func GetAllLvms ¶
func GetAllLvms() []string
func GetDevicePathForVolumue ¶
func GetDevicePathForVolumue(ctx context.Context, volumeID string) (string, string, string, string, error)
func UpdatePVForNodeAffinity(ctx context.Context, volumeID string, nodename string) error {
pv := GetPV(ctx, volumeID) if pv == nil { return fmt.Errorf("cant got pv for setnodeaddress") } var terms []v1.NodeSelectorTerm var expressions []v1.NodeSelectorRequirement expressions = append(expressions, v1.NodeSelectorRequirement{ Key: "kubernetes.io/hostname", Operator: v1.NodeSelectorOpIn, Values: []string{nodename}, }) terms = append(terms, v1.NodeSelectorTerm{ MatchExpressions: expressions, }) na := v1.VolumeNodeAffinity{ Required: &v1.NodeSelector{ NodeSelectorTerms: terms, }, } _, err := kubeClient.CoreV1().PersistentVolumes().Delete(pv.Name, &metav1.DeleteOptions{}) pv.ResourceVersion="" pv.Spec.NodeAffinity = &na _, err := kubeClient.CoreV1().PersistentVolumes().Create(pv) if err != nil { log.Errorf("update Node Affir: fail to update pv, err: %v", err) return err } return nil
}
func GetFreeForLVM ¶
func GetNodeName ¶
func GetNodeName() string
func GetS3ENV ¶
func GetS3ENV(ctx context.Context, name string, namespace string, s3endpoint string) (string, error)
****************************
func GetSizeForPool ¶
func GetTotalForLVM ¶
func GetVgnameForVolume ¶
*********
func GetVolContentsource ¶
func GetpvnumberForVG ¶
func LoadFromSnapshot ¶
func LoadFromSnapshot(ctx context.Context, snapshotId, devicePath, mountpath string, s3env string) error
loadFromSnapshot populates the given destPath with data from the snapshotID
func MirrorDevicetoS3 ¶
func MirrorS3toDevice ¶
func MountVolforDevice ¶
func SetNodeAddressForPV ¶
*************
func UpdateNode ¶
func UpdateThinForNode ¶
func UpdateThinForNode() error
func Updatenodeslabs ¶
func Updatenodeslabs() error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.