apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  generation: 1
  labels:
    vendor: crunchydata
  name: postgres-operator
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      name: postgres-operator
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: postgres-operator
    spec:
      containers:
        - env:
            - name: CRUNCHY_DEBUG
              value: "true"
            - name: PORT
              value: "8443"
            - name: PGO_INSTALLATION_NAME
              value: devtest
            - name: PGO_OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: TLS_CA_TRUST
            - name: TLS_NO_VERIFY
              value: "false"
            - name: DISABLE_TLS
              value: "false"
            - name: NOAUTH_ROUTES
            - name: ADD_OS_TRUSTSTORE
              value: "false"
            - name: DISABLE_EVENTING
              value: "false"
            - name: EVENT_ADDR
              value: localhost:4150
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 8443
              scheme: HTTPS
            initialDelaySeconds: 15
            periodSeconds: 5
            successThreshold: 1
            timeoutSeconds: 1
          name: apiserver
          ports:
            - containerPort: 8443
              name: api
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthz
              port: 8443
              scheme: HTTPS
            initialDelaySeconds: 15
            periodSeconds: 5
            successThreshold: 1
            timeoutSeconds: 1
          resources: {}
          securityContext:
            allowPrivilegeEscalation: false
            privileged: false
            readOnlyRootFilesystem: true
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /tmp
              name: tmp
        - env:
            - name: CRUNCHY_DEBUG
              value: "true"
            - name: PGO_INSTALLATION_NAME
              value: devtest
            - name: PGO_OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
            - name: DISABLE_EVENTING
              value: "false"
            - name: EVENT_ADDR
              value: localhost:4150
          imagePullPolicy: Always
          name: operator
          readinessProbe:
            exec:
              command:
                - ls
                - /tmp
            failureThreshold: 3
            initialDelaySeconds: 4
            periodSeconds: 5
            successThreshold: 1
            timeoutSeconds: 1
          resources: {}
          securityContext:
            allowPrivilegeEscalation: false
            privileged: false
            readOnlyRootFilesystem: true
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
        - env:
            - name: CRUNCHY_DEBUG
              value: "true"
            - name: PGO_OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: PGO_INSTALLATION_NAME
              value: devtest
            - name: TIMEOUT
              value: "3600"
            - name: EVENT_ADDR
              value: localhost:4150
          imagePullPolicy: Always
          livenessProbe:
            exec:
              command:
                - bash
                - -c
                - test -n "$(find /tmp/scheduler.hb -newermt '61 sec ago')"
            failureThreshold: 2
            initialDelaySeconds: 60
            periodSeconds: 60
            successThreshold: 1
            timeoutSeconds: 1
          name: scheduler
          resources: {}
          securityContext:
            allowPrivilegeEscalation: false
            privileged: false
            readOnlyRootFilesystem: true
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /tmp
              name: tmp
        - env:
            - name: TIMEOUT
              value: "3600"
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /ping
              port: 4151
              scheme: HTTP
            initialDelaySeconds: 15
            periodSeconds: 5
            successThreshold: 1
            timeoutSeconds: 1
          name: event
          resources: {}
          securityContext:
            allowPrivilegeEscalation: false
            privileged: false
            readOnlyRootFilesystem: true
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /tmp
              name: tmp
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext:
        runAsNonRoot: true
      serviceAccount: postgres-operator
      serviceAccountName: postgres-operator
      terminationGracePeriodSeconds: 30
      volumes:
        - emptyDir:
            medium: Memory
            sizeLimit: 16Mi
          name: tmp
