This repository was archived by the owner on Jun 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathpgsql.StatefulSet.yaml
More file actions
109 lines (109 loc) · 3.03 KB
/
pgsql.StatefulSet.yaml
File metadata and controls
109 lines (109 loc) · 3.03 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
description: Postgres database for various data.
kubectl.kubernetes.io/default-container: pgsql
labels:
app.kubernetes.io/component: pgsql
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: pgsql
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: pgsql
serviceName: pgsql
template:
metadata:
labels:
app: pgsql
deploy: sourcegraph
group: backend
spec:
containers:
- image: index.docker.io/sourcegraph/postgresql-16:5.10.2832@sha256:7a637a98960cb7d3ac6705c7f7335874c005ed9f0c68bfaa0e5eebf2d7f71e94
livenessProbe:
exec:
command:
- /liveness.sh
initialDelaySeconds: 15
name: pgsql
ports:
- containerPort: 5432
name: pgsql
readinessProbe:
exec:
command:
- /ready.sh
securityContext:
allowPrivilegeEscalation: false
runAsGroup: 999
runAsUser: 999
startupProbe:
exec:
command:
- /liveness.sh
failureThreshold: 360
periodSeconds: 10
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /data
name: disk
- mountPath: /conf
name: pgsql-conf
- mountPath: /dev/shm
name: dshm
- env:
- name: DATA_SOURCE_NAME
value: postgres://sg:@localhost:5432/?sslmode=disable
- name: PG_EXPORTER_EXTEND_QUERY_PATH
value: /config/queries.yaml
image: index.docker.io/sourcegraph/postgres_exporter:5.9.17785@sha256:001ded6bccde55bcdcdb907b57c847cbe121cc425ae9a22c5e29dc0600aefc96
name: pgsql-exporter
ports:
- containerPort: 9187
name: pgsql-exporter
terminationMessagePolicy: FallbackToLogsOnError
initContainers:
- command:
- sh
- -c
- if [ -d /data/pgdata-12 ]; then chmod 750 /data/pgdata-12; fi
image: index.docker.io/sourcegraph/alpine-3.14:5.9.17785@sha256:e36cf08520e38a27244dea78a5d6519f19cd8aa28b304c6ffeda923bc626a1a1
name: correct-data-dir-permissions
resources:
limits:
cpu: 10m
memory: 50Mi
requests:
cpu: 10m
memory: 50Mi
securityContext:
allowPrivilegeEscalation: false
runAsGroup: 999
runAsUser: 999
volumeMounts:
- mountPath: /data
name: disk
securityContext:
fsGroup: 999
fsGroupChangePolicy: OnRootMismatch
runAsUser: 999
terminationGracePeriodSeconds: 120
volumes:
- name: disk
persistentVolumeClaim:
claimName: pgsql
- configMap:
defaultMode: 511
name: pgsql-conf
name: pgsql-conf
- emptyDir:
medium: Memory
sizeLimit: 1G
name: dshm
updateStrategy:
type: RollingUpdate