---
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: ${OPERATOR_IMAGE_PULL_POLICY}
        volumeMounts:
        - mountPath: /tmp/ansible-operator/runner
          name: runner
          readOnly: true
      - name: operator
        image: ${OPERATOR_IMAGE_NAME}:${OPERATOR_IMAGE_VERSION}
        imagePullPolicy: ${OPERATOR_IMAGE_PULL_POLICY}
        volumeMounts:
        - mountPath: /tmp/ansible-operator/runner
          name: runner
        env:
        - name: WATCH_NAMESPACE
          value: ${OPERATOR_WATCH_NAMESPACE}
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: OPERATOR_NAME
          value: "kiali-operator"
      volumes:
      - name: runner
        emptyDir: {}
