---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: awx-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: awx-operator
  template:
    metadata:
      labels:
        name: awx-operator
    spec:
      serviceAccountName: awx-operator
      containers:
        - name: awx-operator
          image: "{{ operator_image }}:{{ operator_version }}"
          imagePullPolicy: "{{ pull_policy|default('Always') }}"
          volumeMounts:
            - mountPath: /tmp/ansible-operator/runner
              name: runner
          env:
            # Watch all namespaces (cluster-scoped).
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: awx-operator
            - name: ANSIBLE_GATHERING
              value: explicit
            - name: OPERATOR_VERSION
              value: "{{ operator_version }}"
            - name: ANSIBLE_DEBUG_LOGS
              value: "{{ ansible_debug_logs|lower | default('false'|lower) }}"
          livenessProbe:
            httpGet:
              path: /healthz
              port: 6789
            initialDelaySeconds: 15
            periodSeconds: 20
      volumes:
        - name: runner
          emptyDir: {}
