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 pathcodeinsights-db.StatefulSet.yaml
More file actions
98 lines (98 loc) · 3.07 KB
/
codeinsights-db.StatefulSet.yaml
File metadata and controls
98 lines (98 loc) · 3.07 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
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
description: Code Insights Postgres DB instance.
labels:
app.kubernetes.io/component: codeinsights-db
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
name: codeinsights-db
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: codeinsights-db
serviceName: codeinsights-db
template:
metadata:
labels:
app: codeinsights-db
deploy: sourcegraph
group: backend
spec:
containers:
- env:
- name: POSTGRES_DB
value: postgres
- name: POSTGRES_PASSWORD
value: password
- name: POSTGRES_USER
value: postgres
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
- name: POSTGRESQL_CONF_DIR
value: /conf
image: index.docker.io/sourcegraph/postgresql-16-codeinsights:5.10.2832@sha256:96b88fb2fe8bbd735be8ee75e5b49c70d7dc11089ae5fa7307955728adba6a7d
name: codeinsights
ports:
- containerPort: 5432
name: codeinsights-db
securityContext:
allowPrivilegeEscalation: false
runAsGroup: 70
runAsUser: 70
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- mountPath: /var/lib/postgresql/data/
name: disk
- mountPath: /conf
name: codeinsights-conf
- env:
- name: DATA_SOURCE_NAME
value: postgres://postgres:@localhost:5432/?sslmode=disable
- name: PG_EXPORTER_EXTEND_QUERY_PATH
value: /config/code_insights_queries.yaml
image: us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal/postgres_exporter:5.9.17785@sha256:f6a536624f6852b3c906b72bbe3bbcc29004a442de165698e5831f7834487bba
name: pgsql-exporter
ports:
- containerPort: 9187
name: pgsql-exporter
terminationMessagePolicy: FallbackToLogsOnError
initContainers:
- command:
- sh
- -c
- if [ -d /var/lib/postgresql/data/pgdata ]; then chmod 750 /var/lib/postgresql/data/pgdata; fi
image: us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal/alpine-3.14:5.9.17785@sha256:37e5c808adb380a04902e8620dbf44a716509431de4e7151e733609b40344084
name: correct-data-dir-permissions
resources:
limits:
cpu: 10m
memory: 50Mi
requests:
cpu: 10m
memory: 50Mi
securityContext:
allowPrivilegeEscalation: false
runAsGroup: 70
runAsUser: 70
volumeMounts:
- mountPath: /var/lib/postgresql/data/
name: disk
securityContext:
fsGroup: 70
fsGroupChangePolicy: OnRootMismatch
runAsUser: 70
terminationGracePeriodSeconds: 120
volumes:
- name: disk
persistentVolumeClaim:
claimName: codeinsights-db
- configMap:
defaultMode: 511
name: codeinsights-db-conf
name: codeinsights-conf
updateStrategy:
type: RollingUpdate