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
    operatorframework.io/arch.s390x: supported
    operatorframework.io/os.linux: supported
    operatorframework.io/arch.amd64: supported
    operatorframework.io/arch.ppc64le: supported
  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
        intent: projected
      annotations:
        productName: IBM Cloud Platform Common Services
        productID: "068a62892a1e4db39641342e592daa25"
        productMetric: FREE
    spec:
      serviceAccountName: ibm-monitoring-grafana-operator
      hostIPC: false
      hostNetwork: false
      hostPID: false
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/arch
                    operator: In
                    values:
                      - amd64
                      - ppc64le
                      - s390x
      containers:
        - name: grafana
          # Replace this with the built image name
          image: quay.io/dongtest/ibm-monitoring-grafana-operator-amd64:1.11.1
          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.annotations['olm.targetNamespaces']
            - name: DASH_NAMESPACES
              valueFrom:
                configMapKeyRef:
                  name: namespace-scope
                  key: namespaces
            - 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:80cc3936dbd03db742a765057a9e95300f7fbf61948bb9959f656e058a81e14e
            - name: ROUTER_IMAGE
              value: quay.io/opencloudio/icp-management-ingress@sha256:6641653b351901eb9352e06479d75a4babaf746bcd63381a09a58d9192b0953c
            - name: DASHBOARD_CTL_IMAGE
              value: quay.io/opencloudio/dashboard-controller@sha256:bce675b80cd5149f6e97a9bd7c02347464f257f3bc94558239d7c526bef7e90c
            - name: INIT_IMAGE
              value: quay.io/opencloudio/icp-initcontainer@sha256:87b30476a024b7a3870cd6b68c0f859cd29b908e9c99f07375f3dfb29d00b963
            - name: DS_PROXY_IMAGE
              value: quay.io/opencloudio/grafana-ocpthanos-proxy@sha256:570da0bccd634773d46b53f9dc9e1a1a9a3329bd45481ae96ae03b41647394c5
