apiVersion: apps/v1
kind: Deployment
metadata:
  name: ibm-iam-operator
  labels:
     app.kubernetes.io/instance: ibm-iam-operator
     app.kubernetes.io/managed-by: ibm-iam-operator
     app.kubernetes.io/name: ibm-iam-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ibm-iam-operator
  template:
    metadata:
      labels:
        name: ibm-iam-operator
        app.kubernetes.io/instance: ibm-iam-operator
        app.kubernetes.io/managed-by: ibm-iam-operator
        app.kubernetes.io/name: ibm-iam-operator
      annotations:
        productName: IBM Cloud Platform Common Services
        productID: "068a62892a1e4db39641342e592daa25"
        productMetric: FREE
    spec:
      serviceAccountName: ibm-iam-operator
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - amd64
                - ppc64le
                - s390x
      containers:
        - name: ibm-iam-operator
          # Replace this with the built image name
          image: quay.io/opencloudio/ibm-iam-operator:latest
          command:
          - ibm-iam-operator
          imagePullPolicy: Always
          env:
            - name: ICP_PLATFORM_AUTH_IMAGE
              value: quay.io/opencloudio/icp-platform-auth:3.7.1
            - name: ICP_IDENTITY_PROVIDER_IMAGE
              value: quay.io/opencloudio/icp-identity-provider:3.7.1
            - name: ICP_IDENTITY_MANAGER_IMAGE
              value: quay.io/opencloudio/icp-identity-manager:3.7.1
            - name: IAM_POLICY_ADMINISTRATION_IMAGE
              value: quay.io/opencloudio/iam-policy-administration:3.7.1
            - name: IAM_POLICY_DECISION_IMAGE
              value: quay.io/opencloudio/iam-policy-decision:3.7.1
            - name: ICP_SECRET_WATCHER_IMAGE
              value: quay.io/opencloudio/icp-secret-watcher:3.7.1
            - name: ICP_OIDCCLIENT_WATCHER_IMAGE
              value: quay.io/opencloudio/icp-oidcclient-watcher:3.7.1
            - name: IAM_POLICY_CONTROLLER_IMAGE
              value: quay.io/opencloudio/iam-policy-controller:3.7.1
            - name: ICP_IAM_ONBOARDING_IMAGE
              value: quay.io/opencloudio/icp-iam-onboarding:3.7.1
            - name: AUDIT_SYSLOG_SERVICE_IMAGE
              value: quay.io/opencloudio/audit-syslog-service:1.0.8
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "ibm-iam-operator"
          resources:
            limits:
              cpu: 25m
              memory: 320Mi
            requests:
              cpu: 20m
              memory: 80Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
              - ALL
            privileged: false
            readOnlyRootFilesystem: true
