apiVersion: apps/v1
kind: Deployment
metadata:
  name: ext-postgres-operator
  namespace: operators
spec:
  replicas: 1
  selector:
    matchLabels:
      name: ext-postgres-operator
  template:
    metadata:
      labels:
        name: ext-postgres-operator
    spec:
      serviceAccountName: ext-postgres-operator
      containers:
        - name: ext-postgres-operator
          image: movetokube/postgres-operator:0.2
          command:
          - postgres-operator
          imagePullPolicy: Always
          envFrom:
            - secretRef:
                name: ext-postgres-operator
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "ext-postgres-operator"