Home > Enterprise >  Volume GKE invalid disk size
Volume GKE invalid disk size

Time:10-06

I'am trying to create pod with volume persistent disk of 10gb but seems I cannot create disk under 200Gb.

I can see pv listed but pvClaim is on pending. I can see what the pc is Available so I cannot understand what's happen

Please find info below:

Invalid value for field 'resource.sizeGb': '10'. Disk size cannot be smaller than 200 GB., invalid

    kubectl get pvc -n vault-ppd
NAME                 STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS               AGE
pv-vault-ppd-claim   Pending                                      balanced-persistent-disk   2m45s

     kubectl get pv -n vault-ppd
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM                               STORAGECLASS               REASON   AGE
pv-vault-ppd                               10Gi       RWO            Retain           Available   vault/pv-vault-ppd-claim  

My manifest vault-ppd.yaml

    kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: balanced-persistent-disk
provisioner: pd.csi.storage.gke.io
parameters:
  type: pd-standard
  replication-type: regional-pd
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
  - key: topology.gke.io/zone
    values:
    - europe-west1-b
    - europe-west1-c
    - europe-west1-d
---
apiVersion: v1
kind: Namespace
metadata:
  name: vault-ppd
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: vault-ppd
  namespace: vault-ppd
  labels:
    app.kubernetes.io/name: vault-ppd
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-vault-ppd
spec:
  storageClassName: "balanced-persistent-disk"
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  claimRef:
    namespace: vault
    name: pv-vault-ppd-claim
  gcePersistentDisk:
    pdName: gke-vault-volume
    fsType: ext4

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pv-vault-ppd-claim
  namespace: vault-ppd
spec:
  storageClassName: "balanced-persistent-disk"
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

Thx for helps guys

CodePudding user response:

pdName: gke-vault-volume should be a regional replicated disk with size >=200GB, you can just update your PVC/PC with the correct size. If it is not, you can set storageClassName: "" in both the PVC and PV to use the standard default StorageClass that provide standard disk.

CodePudding user response:

Your deployment has regional persistent disks of type pd-standard and replication-type: regional-pd, this means that volumes create a regional persistent disk. As mentioned in documentation the minimum capacity per disk for regional persistent disks is 200 GB . We cannot create a regional-pd with lower GB requirement for a standard disk. So now the workaround is, you can either create a PVC with a larger size or use pd-ssd instead.

Note: To use regional persistent disks of type pd-standard, set the PersistentVolumeClaim.storage attribute to 200Gi or higher. If you need a smaller persistent disk, use pd-ssd instead of pd-standard.

Refer Regional Persistent disks for information.

  • Related