apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: ibm-monitoring
    app.kubernetes.io/instance: grafana
    app.kubernetes.io/managed-by: ibm-monitoring-grafana-operator
  name: ibm-monitoring-grafana-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ibm-monitoring-grafana-operator
  template:
    metadata:
      labels:
        app.kubernetes.io/name: ibm-monitoring
        app.kubernetes.io/instance: grafana
        app.kubernetes.io/managed-by: ibm-monitoring-grafana-operator
        name: ibm-monitoring-grafana-operator
      annotations:
        productName: IBM Cloud Platform Common Services
        productID: "068a62892a1e4db39641342e592daa25"
        productVersion: "3.4.0"
        productMetric: FREE
    spec:
      serviceAccountName: ibm-monitoring-grafana-operator
      hostIPC: false
      hostNetwork: false
      hostPID: false
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - amd64
                - ppc64le
                - s390x
      containers:
        - name: grafana
          # Replace this with the built image name
          image: quay.io/opencloudio/ibm-monitoring-grafana-operator
          command:
          - ibm-monitoring-grafana-operator
          imagePullPolicy: Always
          securityContext:
            privileged: false
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
            capabilities:
              drop:
              - ALL
          resources:
            limits:
              cpu: 50m
              memory: 512Mi
            requests:
              cpu: 20m
              memory: 64Mi
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "ibm-monitoring-grafana-operator"
            - name: GRAFANA_IMAGE
              value: quay.io/opencloudio/grafana@sha256:f394f73be7a7134eafed417260cceb361b67a72394e165b50fc254f6cdc70829
            - name: ROUTER_IMAGE
              value: quay.io/opencloudio/icp-management-ingress@sha256:f6694ea8a461468989874b4b091f1d64366eacb9821cc9836d8100e34f333634
            - name: DASHBOARD_CTL_IMAGE
              value: quay.io/opencloudio/dashboard-controller@sha256:1ee93c6cb1bcad119b4d4397b689b4ddc3c7accb1784b09638c673bca552d7a8
            - name: INIT_IMAGE
              value: quay.io/opencloudio/icp-initcontainer@sha256:9aad9fd724ec9308bec711d7738b5f0ae0c37a72ffb19a26dbcf622f1a603e89
