-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathgitserver.StatefulSet.yaml
More file actions
137 lines (137 loc) · 4.99 KB
/
Copy pathgitserver.StatefulSet.yaml
File metadata and controls
137 lines (137 loc) · 4.99 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
description: Stores clones of repositories to perform Git operations.
labels:
{{- include "sourcegraph.labels" . | nindent 4 }}
{{- if .Values.gitserver.labels }}
{{- toYaml .Values.gitserver.labels | nindent 4 }}
{{- end }}
deploy: sourcegraph
app.kubernetes.io/component: gitserver
name: {{ .Values.gitserver.name }}
spec:
replicas: {{ .Values.gitserver.replicaCount }}
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "sourcegraph.selectorLabels" . | nindent 6 }}
app: gitserver
serviceName: gitserver
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: gitserver
{{- include "sourcegraph.redisChecksum" . | nindent 8 }}
{{- if .Values.sourcegraph.podAnnotations }}
{{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }}
{{- end }}
{{- if .Values.gitserver.podAnnotations }}
{{- toYaml .Values.gitserver.podAnnotations | nindent 8 }}
{{- end }}
labels:
{{- include "sourcegraph.selectorLabels" . | nindent 8 }}
{{- if .Values.sourcegraph.podLabels }}
{{- toYaml .Values.sourcegraph.podLabels | nindent 8 }}
{{- end }}
{{- if .Values.gitserver.podLabels }}
{{- toYaml .Values.gitserver.podLabels | nindent 8 }}
{{- end }}
app: gitserver
group: backend
type: gitserver
deploy: sourcegraph
spec:
containers:
- name: gitserver
args: {{- default (list "run") .Values.gitserver.args | toYaml | nindent 8 }}
image: {{ include "sourcegraph.image" (list . "gitserver") }}
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
env:
{{- include "sourcegraph.redisConnection" .| nindent 8 }}
{{- range $name, $item := .Values.gitserver.env}}
- name: {{ $name }}
{{- $item | toYaml | nindent 10 }}
{{- end }}
{{- include "sourcegraph.openTelemetryEnv" . | nindent 8 }}
terminationMessagePolicy: FallbackToLogsOnError
# Temporary: when migrating from repo names to repo IDs on disk,
# gitserver can take a little while to start up. To avoid killing the
# pod because of a failed liveness probe, we give it 2 minutes to start up.
startupProbe:
tcpSocket:
port: grpc
failureThreshold: 120
periodSeconds: 1
livenessProbe:
initialDelaySeconds: 5
tcpSocket:
port: grpc
timeoutSeconds: 5
ports:
- name: grpc
containerPort: 3178
- name: http-debug
containerPort: 6060
{{- if not .Values.sourcegraph.localDevMode }}
resources:
{{- toYaml .Values.gitserver.resources | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.gitserver.containerSecurityContext | nindent 10 }}
volumeMounts:
- mountPath: /tmp
name: tmpdir
- mountPath: /data/repos
name: repos
{{- if .Values.gitserver.sshSecret }}
- mountPath: /home/sourcegraph/.ssh
name: ssh
{{- end }}
{{- if .Values.gitserver.extraVolumeMounts }}
{{- toYaml .Values.gitserver.extraVolumeMounts | nindent 8 }}
{{- end }}
{{- if .Values.gitserver.extraContainers }}
{{- toYaml .Values.gitserver.extraContainers | nindent 6 }}
{{- end }}
securityContext:
{{- toYaml .Values.gitserver.podSecurityContext | nindent 8 }}
{{- include "sourcegraph.nodeSelector" (list . "gitserver" ) | trim | nindent 6 }}
{{- include "sourcegraph.affinity" (list . "gitserver" ) | trim | nindent 6 }}
{{- include "sourcegraph.tolerations" (list . "gitserver" ) | trim | nindent 6 }}
{{- with .Values.sourcegraph.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "sourcegraph.renderServiceAccountName" (list . "gitserver") | trim | nindent 6 }}
volumes:
- name: tmpdir
emptyDir: {}
- name: repos
{{- if .Values.gitserver.sshSecret }}
- name: ssh
secret:
defaultMode: 0644
secretName: {{ .Values.gitserver.sshSecret }}
{{- end }}
{{- if .Values.gitserver.extraVolumes }}
{{- toYaml .Values.gitserver.extraVolumes | nindent 6 }}
{{- end }}
{{- if .Values.gitserver.priorityClassName }}
priorityClassName: {{ .Values.gitserver.priorityClassName }}
{{- end }}
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
name: repos
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
# The size of disk used to mirror your git repositories.
# If you change this, also change indexed-search's disk size.
storage: {{ .Values.gitserver.storageSize }}
storageClassName: {{ .Values.storageClass.name }}