apiVersion: apps/v1
kind: Deployment
metadata:
  name: etcd-ha-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: etcd-ha-operator
  template:
    metadata:
      labels:
        name: etcd-ha-operator
    spec:
      serviceAccountName: etcd-ha-operator
      containers:
        - name: ansible
          command:
            - /usr/local/bin/ao-logs
            - /tmp/ansible-operator/runner
            - stdout
#          TODO: change the image name
          image: quay.io/alaypatel07/etcd-ha-operator:v0.9.0
          volumeMounts:
            - mountPath: /tmp/ansible-operator/runner
              name: runner
              readOnly: true
        - name: etcd-ha-operator
#          TODO: change the image name
          image: quay.io/alaypatel07/etcd-ha-operator:v0.9.0
          ports:
          - containerPort: 60000
            name: metrics
          imagePullPolicy: Always
          env:
          - name: WATCH_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: OPERATOR_NAME
            value: "etcd-ha-operator"
          volumeMounts:
            - mountPath: /tmp/ansible-operator/runner
              name: runner
      volumes:
        - name: runner
          emptyDir: {}
