apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  labels:
    app: grafana
spec:
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      containers:
        - name: grafana
          image: grafana:v1
          imagePullPolicy: Never
          livenessProbe:
            initialDelaySeconds: 20
            periodSeconds: 10
            timeoutSeconds: 5
            httpGet:
              path: /api/health
              port: 3000
          volumeMounts:
            - name: grafana-config
              subPath: grafana.ini
              mountPath: /etc/grafana/grafana.ini
              readOnly: true
          envFrom:
            - secretRef:
                name: grafana
      volumes:
        - name: grafana-config
          configMap:
            name: grafana
