apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
      name: grafana
    spec:
      containers:
        - image: grafana/grafana:latest
          imagePullPolicy: Always
          name: grafana
          ports:
            - containerPort: 3000
              name: grafana
              protocol: TCP
          volumeMounts:
            - mountPath: /etc/grafana/provisioning/datasources
              name: grafana-datasources
            - mountPath: /etc/grafana/provisioning/dashboards
              name: grafana-provisioner
            - mountPath: /var/lib/grafana/dashboards/
              name: grafana-dashboards
            - mountPath: /var/lib/grafana
              name: grafana-storage
      volumes:
        - emptyDir: {}
          name: grafana-storage
        - name: grafana-datasources
          configMap:
            defaultMode: 420
            name: litmus-grafana-datasources
        - name: grafana-dashboards
          configMap:
            defaultMode: 420
            name: litmus-grafana-dashboards
        - name: grafana-provisioner
          configMap:
            defaultMode: 420
            name: litmus-grafana-provisioner
