Hi Im deploying Grafana in EKS. I used the hostpath as my persistent volume but i receive the error GF_PATHS_DATA=’/var/lib/grafana’ is not writable. I already added security context. How will I resolved the issue?
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana-ewan
namespace: grafana
spec:
replicas: 1
selector:
matchLabels:
app: grafana
template:
metadata:
name: grafana
labels:
app: grafana
spec:
securityContext:
runAsUser: 472
fsGroup: 472
containers:
- name: grafana
# command: ['sh', '-c', 'chown -R 472:472 /var/lib/grafana']
image: grafana/grafana:5.4.2
ports:
- name: grafana
containerPort: 3000
resources:
limits:
memory: "2Gi"
cpu: "1000m"
requests:
memory: "1Gi"
cpu: "500m"
volumeMounts:
- mountPath: /var/lib/grafana
name: grafana-storage
- mountPath: /etc/grafana/provisioning/datasources
name: grafana-datasources
readOnly: false
volumes:
- name: grafana-storage
hostPath:
path: /home/ec2-user
type: Directory
#persistentVolumeClaim:
# claimName: allow
- name: grafana-datasources
configMap:
defaultMode: 420
name: grafana-datasources
nodeSelector:
node: host1