-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathgitserver.StatefulSet.yaml
More file actions
90 lines (90 loc) · 2.8 KB
/
gitserver.StatefulSet.yaml
File metadata and controls
90 lines (90 loc) · 2.8 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
apiVersion: apps/v1
kind: StatefulSet
metadata:
annotations:
description: Stores clones of repositories to perform Git operations.
kubectl.kubernetes.io/default-container: gitserver
labels:
deploy: sourcegraph
sourcegraph-resource-requires: no-cluster-admin
app.kubernetes.io/component: gitserver
name: gitserver
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: gitserver
serviceName: gitserver
template:
metadata:
labels:
app: gitserver
group: backend
type: gitserver
deploy: sourcegraph
spec:
containers:
- name: gitserver
args: ["run"]
env:
# OTEL_AGENT_HOST must be defined before OTEL_EXPORTER_OTLP_ENDPOINT to substitute the node IP on which the DaemonSet pod instance runs in the latter variable
- name: OTEL_AGENT_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: http://$(OTEL_AGENT_HOST):4317
image: us-docker.pkg.dev/sourcegraph-images/internal/gitserver:7.0.2145@sha256:97cb3187bbdb3ba233fd451c4ffbd694f9ade30208bf3cf9f220404f0294dcd8
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: rpc
failureThreshold: 120
periodSeconds: 1
livenessProbe:
initialDelaySeconds: 5
tcpSocket:
port: rpc
timeoutSeconds: 5
ports:
- containerPort: 3178
protocol: TCP
name: rpc
resources:
limits:
cpu: "4"
memory: 8G
requests:
cpu: "4"
memory: 8G
securityContext:
runAsUser: 100
runAsGroup: 101
# Required to prevent escalations to root.
allowPrivilegeEscalation: false
volumeMounts:
- mountPath: /data/repos
name: repos
securityContext:
runAsUser: 100
fsGroup: 101
fsGroupChangePolicy: OnRootMismatch
volumes:
- name: repos
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: 200Gi