apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: grafana
  name: grafana
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      containers:
      - image: grafana/grafana:6.1.6
        name: grafana
        ports:
        - containerPort: 3000
          name: http-grafana
        readinessProbe:
          httpGet:
            path: /api/health
            port: http-grafana
        resources:
          limits:
            cpu: 200m
            memory: 200Mi
          requests:
            cpu: 100m
            memory: 100Mi
        volumeMounts:
        - mountPath: /var/lib/grafana
          name: grafana-storage
          readOnly: false
        - mountPath: /etc/grafana/provisioning/datasources
          name: grafana-datasources-provision
          readOnly: false
        - mountPath: /etc/grafana/provisioning/dashboards
          name: grafana-dashboards-provision
          readOnly: false
        - mountPath: /etc/grafana/dashboards
          name: grafana-dashboards
          readOnly: false
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
      serviceAccountName: grafana
      volumes:
      - emptyDir: {}
        name: grafana-storage
      - name: grafana-datasources-provision
        secret:
          secretName: grafana-datasources-provision
      - configMap:
          name: grafana-dashboards-provision
        name: grafana-dashboards-provision
      - configMap:
          name: grafana-dashboards
        name: grafana-dashboards
