apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      component: grafana
  template:
    metadata:
      labels:
        component: grafana
    spec:
      volumes:
        - name: grafana-dashboard-config
          configMap:
            name: grafana-dashboard-config
        - name: grafana-datasource-influxdb-config
          configMap:
            name: grafana-datasource-influxdb-config
      containers:
        - name: grafana
          image: grafana/grafana
          volumeMounts:
            - name: grafana-dashboard-config
              mountPath: /etc/grafana/provisioning/dashboards/
            - name: grafana-datasource-influxdb-config
              mountPath: /etc/grafana/provisioning/datasources/
          ports:
            - containerPort: 3000
          env:
            - name: GF_AUTH_ANONYMOUS_ENABLED
              value: 'true'
            - name: GF_AUTH_ANONYMOUS_ORG_ROLE
              value: 'Admin'

