I do have multiple persistent volumes which need to be shrinked to reduce the hosting costs. I already figured out that Kubernetes does not provide such an option. I also tried to clone or the restore the volumes from an snapshot to a new smaller volume - with the same result (requested volume size XXX is less than the size XXX for the source snapshot
).
Nevertheless I need a solution or workaround to get this done.
The cluster is deployed with Rancher and the volumes are mounted to a Ceph Cluster. Everything is provided by an external hoster.
Finally I achieved what needed with the following steps (still tricky and manual work):
job-template.yaml
set the source and destination volume