Skip to content

Instantly share code, notes, and snippets.

@jmrobles
Last active April 24, 2021 10:04
Show Gist options
  • Save jmrobles/62465ae8a8c2d960ff4ae1f7a345642a to your computer and use it in GitHub Desktop.
Save jmrobles/62465ae8a8c2d960ff4ae1f7a345642a to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: pgbouncer
name: pgbouncer
spec:
replicas: 1
selector:
matchLabels:
app: pgbouncer
template:
metadata:
labels:
app: pgbouncer
spec:
containers:
- env:
- name: DB_HOST
valueFrom:
configMapKeyRef:
key: POSTGRES_HOST_INNER
name: config
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: POSTGRES_PASSWORD
name: secrets
- name: DB_USER
valueFrom:
configMapKeyRef:
key: POSTGRES_USER
name: config
- name: POOL_MODE
value: transaction
- name: SERVER_RESET_QUERY
value: DISCARD ALL
image: edoburu/pgbouncer:1.9.0
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- killall -INT pgbouncer && sleep 120
name: pgbouncer
ports:
- containerPort: 5432
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment