I have a minikube cluster with a grafana pod running in it.
I have mounted a directory for grafana to use as a persistant volume to store.
minikube mount /var/tmp/minikube-folder1:/folder1
I receive the output
📁 Mounting host path /var/tmp/minikube-folder1 into VM as /folder1 ...
▪ Mount type: 9p
▪ User ID: docker
▪ Group ID: docker
▪ Version: 9p2000.L
▪ Message Size: 262144
▪ Options: map[]
▪ Bind Address: 127.0.0.1:64221
🚀 Userspace file server: ufs starting
✅ Successfully mounted /var/tmp/minikube-folder1 to /folder1
i bind to the folder as such in my grafana yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-grafana
spec:
volumeName: grafana-pv
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: grafana-pv
spec:
storageClassName: standard
accessModes:
- ReadWriteMany
capacity:
storage: 2Gi
hostPath:
path: /folder1
and eventually mount it on my container as such
[spec..tempalate..spec above]
containers:
- name: mygrafana
image: grafana/grafana
ports:
- containerPort: 3000
volumeMounts:
- name: grafana-storage
mountPath: /var/lib/grafana
volumes:
- name: grafana-storage
persistentVolumeClaim:
claimName: pvc-grafana
my grafana pod cant launch and always complains the permissions arent correct on /var/lib/grafana
I can remedy it by manually going into /var/tmp/minikube-folder1/
and chmod 777
ing the folders each time a new one appears (ex /var/lib/grafana/alerting), but this seems like an inefficient and wrong strategy.
Is there someway to not have the minikube setup have these filesystem permission conflicts?