PersistentVolumeClaim fails to create on Alicloud Kubernetes

11/26/2018

I am trying to create a Dynamic storage volume on Kubernetes in Ali cloud. First I have created a storage class.

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: alicloud-pv-class
provisioner: alicloud/disk
parameters:
  type: cloud_ssd
  regionid: cn-beijing
  zoneid: cn-beijing-b

Then, tried creating a persistence volume claim as per below.

apiVersion: v1
kind: List
items:
- kind: PersistentVolumeClaim
  apiVersion: v1
  metadata:
    name: node-pv
  spec:
    accessModes:
      - ReadWriteOnce
    storageClassName: alicloud-pv-class
    resources:
      requests:
        storage: 64Mi

Creation of persistence volume fails with the following error.

Warning ProvisioningFailed 0s alicloud/disk alicloud-disk-controller-68dd8f98cc-z6ql5 5ef317c7-f110-11e8-96de-0a58ac100006 Failed to provision volume with StorageClass "alicloud-pv-class": Aliyun API Error: RequestId: 7B2CA409-3FDE-4BA1-85B9-80F15109824B Status Code: 400 Code: InvalidParameter Message: The specified parameter "Size" is not valid.

I am not sure where this Size parameter is specified. Did anyone come across a similar problem?

-- ygnr
alibaba-cloud
kubernetes

1 Answer

11/26/2018

As pointed out in the docs, the minimum size for SSD is 20Gi, so I'd suggest to change storage: 64Mi to storage: 20Gi to fix it.

-- Michael Hausenblas
Source: StackOverflow