apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  generation: 2
  labels:
    name: some-name-disabled-backrest-shared-repo
    pg-cluster: some-name-disabled
    pgo-backrest-repo: "true"
    service-name: some-name-disabled-backrest-shared-repo
    vendor: crunchydata
  name: some-name-disabled-backrest-shared-repo
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      name: some-name-disabled-backrest-shared-repo
      pg-cluster: some-name-disabled
      pg-pod-anti-affinity: disabled
      pgo-backrest-repo: "true"
      service-name: some-name-disabled-backrest-shared-repo
      vendor: crunchydata
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      annotations:
        keep-backups: "false"
        keep-data: "false"
      labels:
        name: some-name-disabled-backrest-shared-repo
        pg-cluster: some-name-disabled
        pg-pod-anti-affinity: disabled
        pgo-backrest-repo: "true"
        service-name: some-name-disabled-backrest-shared-repo
        vendor: crunchydata
    spec:
      affinity: {}
      containers:
        - env:
            - name: MODE
              value: pgbackrest-repo
            - name: PGBACKREST_STANZA
              value: db
            - name: PGBACKREST_DB_PATH
              value: /pgdata/some-name-disabled
            - name: PGBACKREST_REPO1_PATH
              value: /backrestrepo/some-name-disabled-backrest-shared-repo
            - name: PGBACKREST_PG1_PORT
              value: "5432"
            - name: PGBACKREST_LOG_PATH
              value: /tmp
            - name: PGBACKREST_PG1_SOCKET_PATH
              value: /tmp
            - name: PGBACKREST_DB_HOST
              value: some-name-disabled
            - name: LD_PRELOAD
              value: /usr/lib64/libnss_wrapper.so
            - name: NSS_WRAPPER_PASSWD
              value: /tmp/nss_wrapper/pgbackrest-repo/passwd
            - name: NSS_WRAPPER_GROUP
              value: /tmp/nss_wrapper/pgbackrest-repo/group
          imagePullPolicy: IfNotPresent
          name: database
          ports:
            - containerPort: 2022
              name: pgbackrest
              protocol: TCP
          resources:
            requests:
              memory: 48Mi
          securityContext:
            allowPrivilegeEscalation: false
            privileged: false
            readOnlyRootFilesystem: true
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /sshd
              name: sshd
              readOnly: true
            - mountPath: /etc/ssh
              name: ssh-config
              readOnly: true
            - mountPath: /backrestrepo
              name: backrestrepo
            - mountPath: /tmp
              name: tmp
            - mountPath: /home/pgbackrest
              name: pgbackrest-home
            - mountPath: /etc/pgbackrest
              name: pgbackrest-conf
            - mountPath: /etc/pgbackrest/conf.d
              name: pgbackrest-config
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext:
        runAsNonRoot: true
      serviceAccount: pgo-default
      serviceAccountName: pgo-default
      terminationGracePeriodSeconds: 30
      volumes:
        - name: sshd
          secret:
            defaultMode: 420
            secretName: some-name-disabled-backrest-repo-config
        - name: ssh-config
          secret:
            defaultMode: 420
            items:
              - key: config
                path: ssh_config
            secretName: some-name-disabled-backrest-repo-config
        - name: backrestrepo
          persistentVolumeClaim:
            claimName: some-name-disabled-pgbr-repo
        - emptyDir:
            medium: Memory
            sizeLimit: 64Mi
          name: tmp
        - emptyDir:
            medium: Memory
            sizeLimit: 128Ki
          name: pgbackrest-home
        - emptyDir:
            medium: Memory
            sizeLimit: 128Ki
          name: pgbackrest-conf
        - name: pgbackrest-config
          projected:
            defaultMode: 420
            sources:
              - configMap:
                  name: some-name-disabled-config-backrest
                  optional: true
              - secret:
                  name: some-name-disabled-config-backrest
                  optional: true
