apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: grafana
  name: grafana
  namespace: grafana-dashboard
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
  template:
    metadata:
      labels:
        app: grafana
    spec:
      containers:
        - image: grafana/grafana:7.1.0
          imagePullPolicy: IfNotPresent
          name: grafana
          envFrom:
            - secretRef:
                name: grafana-config
          ports:
            - containerPort: 3000
              name: http
          readinessProbe:
            httpGet:
              path: /api/health
              port: http
          resources:
            limits:
              cpu: 200m
              memory: 200Mi
            requests:
              cpu: 100m
              memory: 100Mi
          securityContext:
            allowPrivilegeEscalation: false
          volumeMounts:
            - mountPath: /var/lib/grafana
              name: grafana-storage
              readOnly: false
            - mountPath: /etc/grafana/provisioning/datasources
              name: grafana-datasources
              readOnly: true
            - mountPath: /var/lib/grafana/dashboards/ocp4-powervs-e2e.json
              name: ocp4-powervs-e2e
              subPath: ocp4-powervs-e2e.json
              readOnly: false
            - mountPath: /var/lib/grafana/dashboards/ocp4-powervs-scale.json
              name: ocp4-powervs-scale
              subPath: ocp4-powervs-scale.json
              readOnly: false
            - mountPath: /var/lib/grafana/dashboards/ocp4-powervm-e2e.json
              name: ocp4-powervm-e2e
              subPath: ocp4-powervm-e2e.json
              readOnly: false
            - mountPath: /var/lib/grafana/dashboards/ocp4-powervm-scale.json
              name: ocp4-powervm-scale
              subPath: ocp4-powervm-scale.json
              readOnly: false
            - mountPath: /etc/grafana/provisioning/dashboards/grafana-dashboard-provider.yaml
              name: grafana-dashboard-provider
              readOnly: true
              subPath: grafana-dashboard-provider.yaml
      securityContext:
        seccompProfile:
          type: RuntimeDefault
        runAsUser: 1000
        runAsGroup: 1000
      volumes:
        - emptyDir: {}
          name: grafana-storage
        - name: grafana-datasources
          secret:
            secretName: grafana-datasources
        - configMap:
            name: grafana-dashboard-provider
          name: grafana-dashboard-provider
        - configMap:
            name: ocp4-powervs-e2e
          name: ocp4-powervs-e2e
        - configMap:
            name: ocp4-powervs-scale
          name: ocp4-powervs-scale
        - configMap:
            name: ocp4-powervm-e2e
          name: ocp4-powervm-e2e
        - configMap:
            name: ocp4-powervm-scale
          name: ocp4-powervm-scale
