apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: grafana
  namespace: monitoring-tools
spec:
  replicas: 1
  serviceName: grafana
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      serviceAccountName: monitoring-tools
      securityContext:
        runAsUser: 472
        fsGroup: 472
      containers:
        - name: grafana
          image: grafana/grafana:6.7.3
          ports:
            - containerPort: 3000
              protocol: TCP
          volumeMounts:
            - mountPath: /var/lib/grafana
              name: grafana-volume
              readOnly: false
  volumeClaimTemplates:
    - metadata:
        name: grafana-volume
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 128Gi
        storageClassName: standard
