kind: Deployment
apiVersion: apps/v1
metadata:
  name: grafana
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      name: grafana
      labels:
        app: grafana
    spec:
      containers:
        - name: grafana
          livenessProbe:
            httpGet:
              path: /api/health
              port: 3000
              scheme: HTTP
            initialDelaySeconds: 60
            timeoutSeconds: 30
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 10          
          ports:
            - name: grafana-http
              containerPort: 3000
              protocol: TCP
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: grafana-config
              mountPath: /etc/grafana/
            - name: grafana-data
              mountPath: /var/lib/grafana
          image: ${GRAFANA_IMAGE}
          args:
            - '-config=/etc/grafana/grafana.ini'
      volumes:
        - name: grafana-config
          configMap:
            name: grafana-config
            defaultMode: 420
        - name: grafana-data
          persistentVolumeClaim:
            claimName: grafana-data
