How to shrink a PVC (without downtime)


I am using glusterfs as storage.

Here is my storage class:

kind: StorageClass
  name: standard
  resturl: ""
  restauthenabled: "false"
  restuser: "notusedyet"
  restuserkey: "notusedyet"
  volumetype: replicate:2
allowVolumeExpansion: true

I created a pvc of 10Gi, but I am not using much of it. So I wanted to shrink it. If I update the pvc I get following error:

The PersistentVolumeClaim "poc-redis" is invalid: Forbidden: field can not be less than previous value

So what options do I have to shrink this volume? Are there any ways with or without downtime are available? (better without downtime)

In worst case: is there a way to clone a volume to a new one which is smaller?

Thanks, Andreas

There is no method of shrinking volumes directly. You could probably remove the volume from Kubernetes and shrink it outside of it (if gluster supports it) and then map it back in as a new volume, or clone/shrink and remount.