apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: monitoring
  name: grafana
  labels:
    app: grafana
spec:
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      securityContext:
        fsGroup: 472
      containers:
      - envFrom:
        - secretRef:
            name: grafana-creds
        name: grafana
        image: grafana/grafana
        ports:
        - containerPort: 3000
          name: http
        volumeMounts:
          - name: grafana-storage
            mountPath: /var/lib/grafana
      volumes:
        - name: grafana-storage
          persistentVolumeClaim:
            claimName: grafana-storage
