apiVersion: apps/v1
kind: Deployment
metadata:
  name: gleam-playground-pgbouncer
  namespace: gleam-playground
spec:
  replicas: 1
  selector:
    matchLabels:
      io.service: gleam-playground-pgbouncer
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        io.service: gleam-playground-pgbouncer
    spec:
      containers:
      - envFrom:
        - secretRef:
            name: gleam-playground-secret
            optional: false
        image: edoburu/pgbouncer:1.9.0
        lifecycle:
          preStop:
            exec:
              command:
              - /bin/sh
              - -c
              - killall -INT pgbouncer && sleep 120
        livenessProbe:
          periodSeconds: 60
          tcpSocket:
            port: 5432
        name: gleam-playground-pgbouncer
        ports:
        - containerPort: 5432
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
            - all
      hostNetwork: false
