forked from sourcegraph/deploy-sourcegraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pgsql.Deployment.yaml
87 lines (87 loc) · 2.34 KB
/
pgsql.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
description: Postgres database for various data.
labels:
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
app.kubernetes.io/component: pgsql
name: pgsql
spec:
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: pgsql
strategy:
type: Recreate
template:
metadata:
labels:
deploy: sourcegraph
app: pgsql
group: backend
spec:
initContainers:
- name: correct-data-dir-permissions
image: sourcegraph/alpine:3.12@sha256:133a0a767b836cf86a011101995641cf1b5cbefb3dd212d78d7be145adde636d
command: ["sh", "-c", "if [ -d /data/pgdata-11 ]; then chmod 750 /data/pgdata-11; fi"]
volumeMounts:
- mountPath: /data
name: disk
securityContext:
runAsUser: 0
containers:
- env:
image: index.docker.io/sourcegraph/postgres-11.4:3.21.1@sha256:a55fea6638d478c2368c227d06a1a2b7a2056b693967628427d41c92d9209e97
terminationMessagePolicy: FallbackToLogsOnError
readinessProbe:
exec:
command:
- /ready.sh
livenessProbe:
initialDelaySeconds: 15
exec:
command:
- /liveness.sh
name: pgsql
ports:
- containerPort: 5432
name: pgsql
resources:
limits:
cpu: "4"
memory: 2Gi
requests:
cpu: "4"
memory: 2Gi
volumeMounts:
- mountPath: /data
name: disk
- mountPath: /conf
name: pgsql-conf
- env:
- name: DATA_SOURCE_NAME
value: postgres://sg:@localhost:5432/?sslmode=disable
image: wrouesnel/postgres_exporter:v0.7.0@sha256:785c919627c06f540d515aac88b7966f352403f73e931e70dc2cbf783146a98b
terminationMessagePolicy: FallbackToLogsOnError
name: pgsql-exporter
resources:
limits:
cpu: 10m
memory: 50Mi
requests:
cpu: 10m
memory: 50Mi
securityContext:
runAsUser: 0
volumes:
- name: disk
persistentVolumeClaim:
claimName: pgsql
- name: pgsql-conf
configMap:
defaultMode: 0777
name: pgsql-conf