apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana
spec:
  selector:
    matchLabels:
      app: grafana
  replicas: 1
  template:
    metadata:
      labels:
        app: grafana
    spec:
      containers:
        - name: grafana
          image: grafana/grafana:master-ubuntu
          env:
            - name: GF_SECURITY_ADMIN_PASSWORD
              value: admin
          ports:
            - containerPort: 3000
              name: grafana
          volumeMounts:
            - mountPath: /etc/grafana/provisioning/datasources
              name: grafana-datasources
            - mountPath: /etc/grafana/provisioning/dashboards
              name: grafana-dashboards
      volumes:
        - name: grafana-datasources
          configMap:
            name: grafana-datasources
            items:
              - key: grafana-datasources.yaml
                path: datasources.yaml
        - name: grafana-dashboards
          configMap:
            name: grafana-dashboards
            items:
              - key: grafana-dashboard-metrics-server.json
                path: metrics-server.json
              - key: grafana-dashboard-prometheus-app.json
                path: prometheus-app.json
              - key: grafana-dashboards.yaml
                path: dashboard.yml

