apiVersion: apps/v1
kind: Deployment
metadata:
  name: game-server-operator
spec:
  replicas: 1
  selector:
    matchLabels:
      name: game-server-operator
  template:
    metadata:
      labels:
        name: game-server-operator
    spec:
      serviceAccountName: game-server-operator
      containers:
        - name: operator
          # Replace this with the built image name
          image: docker.io/fabianvf/game-server-operator:latest
          imagePullPolicy: Always
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: ansible-operator
          env:
            - name: WATCH_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "game-server-operator"
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
        - name: ansible
          command:
          - /usr/local/bin/ao-logs
          - /tmp/ansible-operator/runner
          - stdout
          image: quay.io/operator-framework/ansible-operator:v0.10.0
          imagePullPolicy: IfNotPresent
          volumeMounts:
          - mountPath: /tmp/ansible-operator/runner
            name: runner
            readOnly: true
      volumes:
        - name: runner
          emptyDir: {}
