apiVersion: apps/v1
kind: Deployment
metadata:
  name: deployer
  namespace: deployer
spec:
  replicas: 1
  selector:
    matchLabels:
      name: deployer
  template:
    metadata:
      labels:
        name: deployer
    spec:
      imagePullSecrets:
        - name: deployer-docker-pull
      serviceAccountName: deployer
      containers:
        - name: deployer
          image: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA}
          imagePullPolicy: Always
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "deployer"
            - name: CONFIG_FILE
              value: /etc/deployer/config.yaml
          volumeMounts:
            - name: config
              mountPath: /etc/deployer
      volumes:
        - name: config
          configMap:
            name: deployer-config
