Documentation ¶
Index ¶
- Constants
- func CreatePV(ctx context.Context, kubeCli kubernetes.Interface, vol *blockstorage.Volume, ...) (string, error)
- func CreatePVC(ctx context.Context, kubeCli kubernetes.Interface, ns, name string, ...) (string, error)
- func CreatePVCFromSnapshot(ctx context.Context, args *CreatePVCFromSnapshotArgs) (string, error)
- func DeletePVC(cli kubernetes.Interface, namespace, pvcName string) error
- type CreatePVCFromSnapshotArgs
Constants ¶
const ( // NoPVCNameSpecified is used by the caller to indicate that the PVC name // should be auto-generated NoPVCNameSpecified = "" RegionZoneSeparator = "__" )
Variables ¶
This section is empty.
Functions ¶
func CreatePV ¶
func CreatePV( ctx context.Context, kubeCli kubernetes.Interface, vol *blockstorage.Volume, volType blockstorage.Type, annotations map[string]string, accessmodes []corev1.PersistentVolumeAccessMode, volumemode *corev1.PersistentVolumeMode, ) (string, error)
CreatePV creates a PersistentVolume and returns its name For retry idempotency, checks whether PV associated with volume already exists
func CreatePVC ¶
func CreatePVC( ctx context.Context, kubeCli kubernetes.Interface, ns, name string, sizeInBytes int64, targetVolID string, annotations map[string]string, accessmodes []corev1.PersistentVolumeAccessMode, volumemode *corev1.PersistentVolumeMode, ) (string, error)
CreatePVC creates a PersistentVolumeClaim and returns its name An empty 'targetVolID' indicates the caller would like the PV to be dynamically provisioned An empty 'name' indicates the caller would like the name to be auto-generated An error indicating that the PVC already exists is ignored (for idempotency)
func CreatePVCFromSnapshot ¶
func CreatePVCFromSnapshot(ctx context.Context, args *CreatePVCFromSnapshotArgs) (string, error)
CreatePVCFromSnapshot will restore a volume and returns the resulting PersistentVolumeClaim and any error that happened in the process.
Types ¶
type CreatePVCFromSnapshotArgs ¶
type CreatePVCFromSnapshotArgs struct { KubeCli kubernetes.Interface DynCli dynamic.Interface Namespace string VolumeName string StorageClassName string SnapshotName string RestoreSize string Labels map[string]string Annotations map[string]string VolumeMode *corev1.PersistentVolumeMode AccessModes []corev1.PersistentVolumeAccessMode GroupVersion schema.GroupVersion }
CreatePVCFromSnapshotArgs describes the arguments for CreatePVCFromSnapshot 'VolumeName' is the name of the PVC that will be restored from the snapshot. 'StorageClassName' is the name of the storage class used to create the PVC. 'SnapshotName' is the name of the VolumeSnapshot that will be used for restoring. 'Namespace' is the namespace of the VolumeSnapshot. The PVC will be restored to the same namepsace. 'RestoreSize' will override existing restore size from snapshot content if provided. 'Labels' will be added to the PVC. 'Annotations' will be added to the PVC.