I've seen this question come up often, and I've yet to find a clean, generic solution. I'm just learning Kubernetes so maybe there's something basic I'm missing. But here's what I've done:
- install docker-desktop with kubernetes
- manually create a persistent-storage volume using a yaml file (shown below)
helm install redis dandydev/redis-ha
Or you can use any other helm chart, be it elasticsearch, postgres, you name it. I always get pod has unbound immediate PersistentVolumeClaims
.
Also when I run: kubectl get storageclasses.storage.k8s.io
I do have (default) storage:
NAME PROVISIONER AGE
hostpath (default) docker.io/hostpath 3h8m
Can anyone please help me fix this issue in a generic way? So that I can actually install helm charts and have them automatically connect to a persistent storage volume?
My volume.yaml:
kind: PersistentVolume
apiVersion: v1
metadata:
name: redis-volume
labels:
type: local
app: redis
spec:
storageClassName: ""
capacity:
storage: 5Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/redis"