apiVersion: apps/v1
kind: Deployment
metadata:
  name: aci-operator
  namespace: aci-containers-system
spec:
  replicas: 1
  selector:
    matchLabels:
      name: aci-operator
  template:
    metadata:
      labels:
        name: aci-operator
    spec:
      tolerations:
      - key: "node-role.kubernetes.io/master"
        operator: "Exists"
        effect: "NoSchedule"
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
      serviceAccountName: aci-operator-serviceaccount
      containers:
        - name: ansible
          command:
          - /usr/local/bin/ao-logs
          - /tmp/ansible-operator/runner
          - stdout
          image: "kentwu111/rmlab-aci-operator:apic4.2-v1alpha2"
          imagePullPolicy: "Always"
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
            readOnly: true
          - mountPath: /usr/local/etc/aci-cert/
            name: aci-user-cert-volume
          - name: aci-containers-config-volume
            mountPath: /opt/ansible/aci-containers-config/
        - name: operator
          image: "kentwu111/rmlab-aci-operator:apic4.2-v1alpha2"
          imagePullPolicy: "Always"
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
          - mountPath: /usr/local/etc/aci-cert/
            name: aci-user-cert-volume
          - name: aci-containers-config-volume
            mountPath: /opt/ansible/aci-containers-config/
          - name: mso-access-volume
            mountPath: /opt/ansible/mso-access/
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "aci-operator"
      volumes:
        - name: runner
          emptyDir: {}
        - name: aci-containers-config-volume
          configMap:
            name: aci-containers-config
        - name: aci-user-cert-volume
          secret:
            defaultMode: 420
            secretName: aci-user-cert
        - name: mso-access-volume
          secret:
            defaultMode: 420
            secretName: mso-access
