-
Notifications
You must be signed in to change notification settings - Fork 125
/
Copy pathsourcegraph-frontend.Deployment.yaml
102 lines (102 loc) · 2.9 KB
/
sourcegraph-frontend.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
99
100
101
102
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
description: Serves the frontend of Sourcegraph via HTTP(S).
labels:
deploy: sourcegraph
name: sourcegraph-frontend
spec:
minReadySeconds: 10
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: sourcegraph-frontend
strategy:
rollingUpdate:
maxSurge: 2
maxUnavailable: 0
type: RollingUpdate
template:
metadata:
labels:
app: sourcegraph-frontend
spec:
containers:
- args:
- serve
env:
# TODO(slimsag): After 3.0 (NOT 3.0-preview), we can remove this. It is
# left here now so that users upgrading to 3.0 will leave it here so
# that the DB will be populated with their old site config file
# (i.e. for migration). This means that for now we have two sources of
# truth for the 'default' cluster configuration: The config-map in this
# repository and the confdefaults.Cluster variable in our main repo.
- name: SOURCEGRAPH_CONFIG_FILE
value: /etc/sourcegraph/config.json
- name: PGDATABASE
value: sg
- name: PGHOST
value: pgsql
- name: PGPORT
value: "5432"
- name: PGSSLMODE
value: disable
- name: PGUSER
value: sg
- name: SRC_GIT_SERVERS
value: gitserver-0.gitserver:3178
# POD_NAME is used by CACHE_DIR
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
# CACHE_DIR stores larger items we cache. Majority of it is zip
# archives of repositories at a commit.
- name: CACHE_DIR
value: /mnt/cache/$(POD_NAME)
image: sourcegraph/frontend:3.1.1@sha256:daa8df26820205b37baec55e979050bf9f96a04f0b46a5a6d7a4acee2b419e77
terminationMessagePolicy: FallbackToLogsOnError
livenessProbe:
httpGet:
path: /healthz
port: http
scheme: HTTP
initialDelaySeconds: 300
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: http
scheme: HTTP
periodSeconds: 5
timeoutSeconds: 5
name: frontend
ports:
- containerPort: 3080
name: http
- containerPort: 3090
name: http-internal
resources:
limits:
cpu: "2"
memory: 4G
requests:
cpu: "2"
memory: 2G
volumeMounts:
- mountPath: /etc/sourcegraph
name: sg-config
- mountPath: /mnt/cache
name: cache-ssd
securityContext:
runAsUser: 0
serviceAccountName: sourcegraph-frontend
volumes:
- configMap:
defaultMode: 464
name: config-file
name: sg-config
- emptyDir: {}
name: cache-ssd