Documentation ¶
Index ¶
- Constants
- func NewStorageClass(opts ...StorageClassOption) (*storagev1.StorageClass, error)
- type Kubeclient
- func (k *Kubeclient) Create(ctx context.Context, sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
- func (k *Kubeclient) CreateCollection(ctx context.Context, list *storagev1.StorageClassList) (*storagev1.StorageClassList, error)
- func (k *Kubeclient) Delete(ctx context.Context, name string, deleteOpts *metav1.DeleteOptions) error
- func (k *Kubeclient) DeleteCollection(ctx context.Context, listOpts metav1.ListOptions, ...) error
- func (k *Kubeclient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1.StorageClass, error)
- func (k *Kubeclient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.StorageClassList, error)
- func (k *Kubeclient) Update(ctx context.Context, sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
- type KubeclientBuildOption
- type StorageClassOption
- func WithAllowedTopologies(allowedTopologies map[string][]string) StorageClassOption
- func WithAnnotations(annotations map[string]string) StorageClassOption
- func WithBlockDeviceSelectors(bdSelectors map[string]string) StorageClassOption
- func WithDevice() StorageClassOption
- func WithExt4Quota(softLimit, hardLimit string) StorageClassOption
- func WithFSType(filesystem string) StorageClassOption
- func WithGenerateName(generateName string) StorageClassOption
- func WithHostpath(hostpathDir string) StorageClassOption
- func WithLabels(labels map[string]string) StorageClassOption
- func WithLocalPV() StorageClassOption
- func WithName(name string) StorageClassOption
- func WithNodeAffinityLabels(nodeLabelKeys []string) StorageClassOption
- func WithParameters(parameters map[string]string) StorageClassOption
- func WithReclaimPolicy(reclaimPolicy corev1.PersistentVolumeReclaimPolicy) StorageClassOption
- func WithVolumeBindingMode(volBindingMode storagev1.VolumeBindingMode) StorageClassOption
- func WithXfsQuota(softLimit, hardLimit string) StorageClassOption
Constants ¶
const ( //These are from 'app' package // cmd/provisioner-localpv/app/config.go KeyQuotaSoftLimit = "softLimitGrace" KeyQuotaHardLimit = "hardLimitGrace" )
Variables ¶
This section is empty.
Functions ¶
func NewStorageClass ¶
func NewStorageClass(opts ...StorageClassOption) (*storagev1.StorageClass, error)
Types ¶
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on StorageClass instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeClient returns a new instance of kubeclient
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(ctx context.Context, sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
Create creates a StorageClass in kubernetes cluster
func (*Kubeclient) CreateCollection ¶
func (k *Kubeclient) CreateCollection( ctx context.Context, list *storagev1.StorageClassList, ) (*storagev1.StorageClassList, error)
CreateCollection creates a list of StorageClasses in kubernetes cluster
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(ctx context.Context, name string, deleteOpts *metav1.DeleteOptions) error
Delete deletes a StorageClass instance from the kubernetes cluster
func (*Kubeclient) DeleteCollection ¶
func (k *Kubeclient) DeleteCollection(ctx context.Context, listOpts metav1.ListOptions, deleteOpts *metav1.DeleteOptions) error
DeleteCollection deletes a collection of StorageClass objects.
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(ctx context.Context, name string, opts metav1.GetOptions) (*storagev1.StorageClass, error)
Get returns a StorageClass resource instances present in kubernetes cluster
func (*Kubeclient) List ¶
func (k *Kubeclient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.StorageClassList, error)
List returns a list of StorageClasses instances present in kubernetes cluster
func (*Kubeclient) Update ¶
func (k *Kubeclient) Update(ctx context.Context, sc *storagev1.StorageClass) (*storagev1.StorageClass, error)
Update updates a StorageClass in kubernetes cluster
type KubeclientBuildOption ¶
type KubeclientBuildOption func(*Kubeclient)
KubeclientBuildOption abstracts creating an instance of kubeclient
func WithClientSet ¶
func WithClientSet(c *kubernetes.Clientset) KubeclientBuildOption
WithClientSet sets the kubernetes client against the kubeclient instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(path string) KubeclientBuildOption
WithKubeConfigPath sets the kubeConfig path against client instance
type StorageClassOption ¶
type StorageClassOption func(*storagev1.StorageClass) error
func WithAllowedTopologies ¶
func WithAllowedTopologies(allowedTopologies map[string][]string) StorageClassOption
func WithAnnotations ¶
func WithAnnotations(annotations map[string]string) StorageClassOption
func WithBlockDeviceSelectors ¶
func WithBlockDeviceSelectors(bdSelectors map[string]string) StorageClassOption
func WithDevice ¶
func WithDevice() StorageClassOption
func WithExt4Quota ¶
func WithExt4Quota(softLimit, hardLimit string) StorageClassOption
func WithFSType ¶
func WithFSType(filesystem string) StorageClassOption
func WithGenerateName ¶
func WithGenerateName(generateName string) StorageClassOption
func WithHostpath ¶
func WithHostpath(hostpathDir string) StorageClassOption
func WithLabels ¶
func WithLabels(labels map[string]string) StorageClassOption
func WithLocalPV ¶
func WithLocalPV() StorageClassOption
func WithName ¶
func WithName(name string) StorageClassOption
func WithNodeAffinityLabels ¶
func WithNodeAffinityLabels(nodeLabelKeys []string) StorageClassOption
func WithParameters ¶
func WithParameters(parameters map[string]string) StorageClassOption
func WithReclaimPolicy ¶
func WithReclaimPolicy(reclaimPolicy corev1.PersistentVolumeReclaimPolicy) StorageClassOption
func WithVolumeBindingMode ¶
func WithVolumeBindingMode(volBindingMode storagev1.VolumeBindingMode) StorageClassOption
func WithXfsQuota ¶
func WithXfsQuota(softLimit, hardLimit string) StorageClassOption