- What Grafana version and what operating system are you using?
v10.0.3
- What are you trying to achieve?
having grafana login, prometheus connector and dashboard imports persist.
- How are you trying to achieve it?
We have grafana configured to use a persistent volume claim and persistent volumes.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: graf-data
namespace: monitoring
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
selector:
matchLabels:
name: nfs-pv-graf
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana
namespace: monitoring
spec:
replicas: 1
selector:
matchLabels:
app: grafana
template:
metadata:
name: grafana
labels:
app: grafana
spec:
nodeSelector:
kubernetes.io/os: linux
containers:
- name: grafana
image: grafana/grafana:latest
ports:
- name: grafana
containerPort: 3000
resources:
limits:
memory: "1Gi"
cpu: "1000m"
requests:
memory: 500M
cpu: "500m"
volumeMounts:
- mountPath: /grafana/
name: grafana-storage
- mountPath: /etc/grafana/provisioning/datasources
name: grafana-datasources
readOnly: false
volumes:
- name: grafana-storage
persistentVolumeClaim:
claimName: graf-data
- name: grafana-datasources
configMap:
defaultMode: 420
name: grafana-datasources
- What happened?
If we have a cluster reboot or control plane reboot, the data (login, dashboard configurations ) are gone.
- What did you expect to happen?
for the login, dashboard configurations to persist.
- Can you copy/paste the configuration(s) that you are having problems with?
kubernetes 1.27.3
Centos 7
Grafana 10.0.3