apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/instance: "operand-deployment-lifecycle-manager"
    app.kubernetes.io/managed-by: "operand-deployment-lifecycle-manager"
    app.kubernetes.io/name: "odlm"
  name: operand-deployment-lifecycle-manager
spec:
  replicas: 1
  selector:
    matchLabels:
      name: operand-deployment-lifecycle-manager
  template:
    metadata:
      labels:
        name: operand-deployment-lifecycle-manager
        app.kubernetes.io/instance: operand-deployment-lifecycle-manager
        app.kubernetes.io/managed-by: "operand-deployment-lifecycle-manager"
        app.kubernetes.io/name: "odlm"
      annotations:
        productName: "IBM Cloud Platform Common Services"
        productID: "068a62892a1e4db39641342e592daa25"
        productMetric: "FREE"
    spec:
      serviceAccountName: operand-deployment-lifecycle-manager
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: beta.kubernetes.io/arch
                operator: In
                values:
                - amd64
                - ppc64le
                - s390x
      containers:
        - name: operand-deployment-lifecycle-manager
          # Replace this with the built image name
          image: quay.io/opencloudio/odlm:latest
          command:
          - odlm
          args:
          - "-v=2"
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: OPERATOR_NAME
              value: "operand-deployment-lifecycle-manager"
          resources:
            limits:
              cpu: 500m
              memory: 512Mi
            requests:
              cpu: 200m
              memory: 200Mi
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
              - ALL
            privileged: false
            readOnlyRootFilesystem: true
            runAsNonRoot: true
