linode / linode-blockstorage-csi-driver

Container Storage Interface (CSI) Driver for Linode Block Storage
Apache License 2.0
66 stars 55 forks source link

Volume expansion #55

Closed phillc closed 4 years ago

phillc commented 4 years ago

Superseeds #29

phillc commented 4 years ago

I pushed a canary image to docker hub

I created an lke cluster

I applied this manifest:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-test
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: linode-block-storage
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: /testmount
          name: pvc-test
      volumes:
      - name: pvc-test
        persistentVolumeClaim:
          claimName: pvc-test

I ran kubectl apply -f ./e2e/test/manifest/linode-blockstorage-csi-driver.yaml (the manifest generated in this repo that is pointed at the canary image)

I ran kubectl edit pvc and changed the spec's storage to 11gb (from 10)

I now see 11gb in cloud manager.

kubectl describe pvc now shows 11gb

kubectl describe pvc
Name:          pvc-test
Namespace:     default
StorageClass:  linode-block-storage
Status:        Bound
Volume:        pvc-ad8c93749e744b57
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: linodebs.csi.linode.com
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      11Gi
Access Modes:  RWO
VolumeMode:    Filesystem
Mounted By:    nginx-deployment-5dcf9ccb57-tsdkq
Events:
  Type     Reason                  Age                   From                                                                                  Message
  ----     ------                  ----                  ----                                                                                  -------
  Normal   Provisioning            114s                  linodebs.csi.linode.com_csi-linode-controller-0_ec6ecbe2-e718-11ea-8fb2-7e2bd7d1d8e2  External provisioner is provisioning volume for claim "default/pvc-test"
  Normal   ExternalProvisioning    106s (x12 over 4m7s)  persistentvolume-controller                                                           waiting for a volume to be created, either by external provisioner "linodebs.csi.linode.com" or manually created by system administrator
  Normal   Provisioning            95s                   linodebs.csi.linode.com_csi-linode-controller-0_f83b2b52-e718-11ea-ae56-ea9c6371ab33  External provisioner is provisioning volume for claim "default/pvc-test"
  Warning  ExternalExpanding       38s                   volume_expand                                                                         Ignoring the PVC: didn't find a plugin capable of expanding the volume; waiting for an external controller to process this PVC.
  Normal   Resizing                38s                   external-resizer linodebs.csi.linode.com                                              External resizer is resizing volume pvc-ad8c93749e744b57
  Normal   VolumeResizeSuccessful  34s                   external-resizer linodebs.csi.linode.com                                              Resize volume succeeded
phillc commented 4 years ago

I pushed a canary image to docker hub

I created an lke cluster with two nodes

I applied this manifest:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-test
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: linode-block-storage
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.14.2
        ports:
        - containerPort: 80
        volumeMounts:
        - mountPath: /testmount
          name: pvc-test
      volumes:
      - name: pvc-test
        persistentVolumeClaim:
          claimName: pvc-test

I ran kubectl edit pvc and changed the spec's storage to 11gb (from 10)

Saw error

error: persistentvolumeclaims "pvc-test" could not be patched: persistentvolumeclaims "pvc-test" is forbidden: only dynamically provisioned pvc can be resized and the storageclass that provisions the pvc must support resize

I ran kubectl apply -f ./e2e/test/manifest/linode-blockstorage-csi-driver.yaml (the manifest generated in this repo that is pointed at the canary image)

I ran kubectl edit pvc and changed the spec's storage to 11gb (from 10), and it was successful.

I now see 11gb in cloud manager.

kubectl describe pvc now shows 11gb

  Warning  ExternalExpanding       46s    volume_expand                                                                         Ignoring the PVC: didn't find a plugin capable of expanding the volume; waiting for an external controller to process this PVC.
  Normal   Resizing                38s    external-resizer linodebs.csi.linode.com                                              External resizer is resizing volume pvc-xxxxx
  Normal   VolumeResizeSuccessful  35s    external-resizer linodebs.csi.linode.com                                              Resize volume succeeded