apiVersion: apps/v1
kind: Deployment
metadata:
  name: kiali-operator
  labels:
    app: kiali-operator
    version: ${OPERATOR_VERSION_LABEL}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kiali-operator
      version: ${OPERATOR_VERSION_LABEL}
  template:
    metadata:
      name: kiali-operator
      labels:
        app: kiali-operator
        version: ${OPERATOR_VERSION_LABEL}
    spec:
      serviceAccountName: kiali-operator
      containers:
        - name: ansible
          command:
          - /usr/local/bin/ao-logs
          - /tmp/ansible-operator/runner
          - stdout
          image: ${OPERATOR_IMAGE_NAME}:${OPERATOR_IMAGE_VERSION}
          imagePullPolicy: "IfNotPresent"
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
            readOnly: true
        - name: operator
          image: ${OPERATOR_IMAGE_NAME}:${OPERATOR_IMAGE_VERSION}
          imagePullPolicy: "IfNotPresent"
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "kiali-operator"
      volumes:
        - name: runner
          emptyDir: {}
