apiVersion: apps/v1
kind: Deployment
metadata:
  name: ibm-licensing-operator
  labels:
    app.kubernetes.io/instance: "ibm-licensing-operator"
    app.kubernetes.io/managed-by: "ibm-licensing-operator"
    app.kubernetes.io/name: "ibm-licensing"
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ibm-licensing-operator
  template:
    metadata:
      labels:
        name: ibm-licensing-operator
        app.kubernetes.io/instance: "ibm-licensing-operator"
        app.kubernetes.io/managed-by: "ibm-licensing-operator"
        app.kubernetes.io/name: "ibm-licensing"
      annotations:
        productName: IBM Cloud Platform Common Services
        productID: "068a62892a1e4db39641342e592daa25"
        productMetric: FREE
    spec:
      serviceAccountName: ibm-licensing-operator
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: kubernetes.io/arch
                    operator: In
                    values:
                      - amd64
                      - ppc64le
                      - s390x
      hostIPC: false
      hostNetwork: false
      hostPID: false
      containers:
        - name: ibm-licensing-operator
          image: quay.io/opencloudio/ibm-licensing-operator:latest
          command:
            - ibm-licensing-operator
          imagePullPolicy: Always
          env:
            - name: IBM_LICENSING_IMAGE
              value: quay.io/opencloudio/ibm-licensing:1.5.0
            - name: IBM_LICENSING_USAGE_IMAGE
              value: quay.io/opencloudio/ibm-licensing-usage:1.5.0
            - name: IBM_LICENSE_SERVICE_REPORTER_UI_IMAGE
              value: quay.io/opencloudio/ibm-license-service-reporter-ui:1.5.0
            - name: IBM_POSTGRESQL_IMAGE
              value: quay.io/opencloudio/ibm-postgresql:12.0.5
            - name: IBM_LICENSE_SERVICE_REPORTER_IMAGE
              value: quay.io/opencloudio/ibm-license-service-reporter:1.5.0
            - name: WATCH_NAMESPACE
              value: ibm-common-services
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "ibm-licensing-operator"
            - name: SA_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.serviceAccountName
          resources:
            limits:
              cpu: 20m
              memory: 150Mi
            requests:
              cpu: 10m
              memory: 50Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            privileged: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
