apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
  labels:
    app: grafana
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      nodeSelector:
        role/data: "true"
      containers:
      - image: grafana/grafana:7.5.7
        name: grafana
        imagePullPolicy: IfNotPresent
        env:
          - name: GF_AUTH_BASIC_ENABLED
            value: "true"
          - name: GF_AUTH_ANONYMOUS_ENABLED
            value: "false"
        volumeMounts:
        - name: datasources
          mountPath: /etc/grafana/provisioning/datasources
        - name: dashboard-providers
          mountPath: /etc/grafana/provisioning/dashboards
        - name: dashboard-defs
          mountPath: /etc/grafana/provisioning/dashboard-defs
      volumes:
      - name: datasources
        configMap:
          name: grafana-datasources
      - name: dashboard-providers
        configMap:
          name: grafana-dashboard-providers
      - name: dashboard-defs
        configMap:
          name: grafana-dashboard-defs
