Simply do not use block storage.
At the moment I use NFS with Ubuntu+Autofs (outside of Kubernetes) with the relatively new Kubernetes local storage. See at the bottom. One advantage compared to e.g. a default Longhorn is RWX instead of RWO.
With sudo mc
you can easily copy stuff back and forth.
You can also easily copy things out of GlusterFS, but in version 7, which I tested a few weeks ago, it is not yet suitable for databases or Redis with many small write operations.
apiVersion: v1
kind: PersistentVolume
metadata:
name: <PV_NAME>
spec:
capacity:
storage: 20Gi
volumeMode: Filesystem
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: <AUTO_FS_PATH>
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- <VM_NAME>
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: <PVC_NAME>
spec:
accessModes:
- ReadWriteMany
storageClassName: local-storage
resources:
requests:
storage: 20Gi