-
Notifications
You must be signed in to change notification settings - Fork 1
/
pgbouncer.yaml
50 lines (50 loc) · 1.11 KB
/
pgbouncer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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: DB_HOST
name: pgbouncer-configs
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: POSTGRES_PASSWORD
name: postgresql-secrets
- name: DB_USER
value: postgres
- name: POOL_MODE
value: transaction
- name: SERVER_RESET_QUERY
value: DISCARD ALL
image: edoburu/pgbouncer:1.15.0
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- killall -INT pgbouncer && sleep 120
name: pgbouncer
ports:
- containerPort: 5432
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- all