---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: pgo-upgrade
  labels:
    postgres-operator.crunchydata.com/control-plane: postgres-operator-upgrade
spec:
  replicas: 1
  strategy: { type: Recreate }
  selector:
    matchLabels:
      postgres-operator.crunchydata.com/control-plane: postgres-operator-upgrade
  template:
    metadata:
      labels:
        postgres-operator.crunchydata.com/control-plane: postgres-operator-upgrade
    spec:
      containers:
      - name: operator
        image: postgres-operator-upgrade
        env:
        - name: PGO_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: CRUNCHY_DEBUG
          value: "true"
        - name: RELATED_IMAGE_PGUPGRADE
          value: "registry.developers.crunchydata.com/crunchydata/crunchy-upgrade:ubi8-5.1.0-0"
        securityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
      serviceAccountName: postgres-operator-upgrade
