-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathcodeinsights-db.Deployment.yaml
98 lines (98 loc) · 3.13 KB
/
codeinsights-db.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
88
89
90
91
92
93
94
95
96
97
98
apiVersion: apps/v1
kind: Deployment
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:
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: codeinsights-db
strategy:
type: Recreate
template:
metadata:
labels:
deploy: sourcegraph
app: codeinsights-db
group: backend
spec:
initContainers:
- name: correct-data-dir-permissions
image: us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal/alpine-3.14:5.11.6271@sha256:568d547fc462fa49d7bc43a4349c9b4527359856d103d233e05b1208ec21dafc
command: ["sh", "-c", "if [ -d /var/lib/postgresql/data/pgdata ]; then chmod 750 /var/lib/postgresql/data/pgdata; fi"]
volumeMounts:
- mountPath: /var/lib/postgresql/data/
name: disk
securityContext:
runAsUser: 0
resources:
limits:
cpu: "10m"
memory: "50Mi"
requests:
cpu: "10m"
memory: "50Mi"
containers:
- name: codeinsights
image: us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal/postgresql-16-codeinsights:5.11.6271@sha256:6640c8b33afcec56b76c5912a22ee12e6b0a73a9e94c768f0536bbd88c6d4eaf
env:
- name: POSTGRES_DB
value: postgres
- name: POSTGRES_PASSWORD # Accessible by Sourcegraph applications on the network only, so password auth is not used.
value: password
- name: POSTGRES_USER
value: postgres
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
- name: POSTGRESQL_CONF_DIR
value: "/conf"
terminationMessagePolicy: FallbackToLogsOnError
ports:
- containerPort: 5432
name: codeinsights-db
resources:
limits:
cpu: "4"
memory: 2Gi
requests:
cpu: "4"
memory: 2Gi
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.11.6271@sha256:2437cfff54ca59e6a921f5852b2b9c68c190fad6e066f62599fa8289ee60f140
terminationMessagePolicy: FallbackToLogsOnError
name: pgsql-exporter
resources:
limits:
cpu: 10m
memory: 50Mi
requests:
cpu: 10m
memory: 50Mi
terminationGracePeriodSeconds: 120
securityContext:
runAsUser: 0
volumes:
- name: disk
persistentVolumeClaim:
claimName: codeinsights-db
- name: codeinsights-conf
configMap:
defaultMode: 0777
name: codeinsights-db-conf