-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
50 lines (50 loc) · 1.42 KB
/
deployment.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:
name: pgbouncer-example
namespace: pgbouncer
labels:
app: pgbouncer-example
spec:
revisionHistoryLimit: 10 # removes old replicasets for deployment rollbacks
strategy:
rollingUpdate:
maxUnavailable: 0 # Avoid Terminating and ContainerCreating at the same time
selector:
matchLabels:
app: pgbouncer-example
template:
metadata:
labels:
app: pgbouncer-example
spec:
# Optional: keep the POD close to the apps:
#nodeSelector:
# purpose: apps
containers:
- name: pgbouncer
image: edoburu/pgbouncer:1.20.1-p0
#imagePullPolicy: Always
ports:
- containerPort: 5432
volumeMounts:
- name: configfiles
mountPath: "/etc/pgbouncer"
readOnly: true # writes update the secret!
livenessProbe:
tcpSocket:
port: 5432
periodSeconds: 60
lifecycle:
preStop:
exec:
# Allow existing queries clients to complete within 120 seconds
command: ["/bin/sh", "-c", "killall -INT pgbouncer && sleep 120"]
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ['all']
volumes:
- name: configfiles
secret:
secretName: pgbouncer-example-config