Skip to content

Commit b8ae283

Browse files
author
Stephen Gutekanst
authored
all: replace minio with sourcegraph/blobstore (#218)
* all: replace minio with sourcegraph/blobstore * all: use insiders tags for blobstore changes * regenerate docs * all: update docker images Produced via: ``` sg ops update-images -t 187572_2022-12-06_cbecc5321c7d -kind helm ./charts/sourcegraph sg ops update-images -t 187572_2022-12-06_cbecc5321c7d -kind helm ./charts/sourcegraph-migrator ``` Signed-off-by: Stephen Gutekanst <[email protected]>
1 parent a8cf897 commit b8ae283

24 files changed

+266
-412
lines changed

charts/sourcegraph-migrator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ In addition to the documented values, the `migrator` service also supports the f
8080
| migrator.args | list | `["up","-db=all"]` | Override default `migrator` container args Available commands can be found at https://docs.sourcegraph.com/admin/how-to/manual_database_migrations |
8181
| migrator.containerSecurityContext | object | `{"allowPrivilegeEscalation":false,"readOnlyRootFilesystem":true,"runAsGroup":101,"runAsUser":100}` | Security context for the `migrator` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) |
8282
| migrator.env | object | `{}` | Environment variables for the `migrator` container |
83-
| migrator.image.defaultTag | string | `"4.2.0@sha256:d816e125395e99d8a25564f5a799f0e9bedf7c6230065619849e169d0865a35e"` | Docker image tag for the `migrator` image |
83+
| migrator.image.defaultTag | string | `"187572_2022-12-06_cbecc5321c7d@sha256:93fc175df594738a98a62f2057271824cdb674b0e63bedac9dc7cb0f04db76bb"` | Docker image tag for the `migrator` image |
8484
| migrator.image.name | string | `"migrator"` | Docker image name for the `migrator` image |
8585
| migrator.resources | object | `{"limits":{"cpu":"500m","memory":"100M"},"requests":{"cpu":"100m","memory":"50M"}}` | Resource requests & limits for the `migrator` container, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) |
8686
| pgsql.auth.existingSecret | string | `""` | Name of existing secret to use for pgsql credentials This should match the setting in the sourcegraph chart values |

charts/sourcegraph-migrator/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pgsql:
102102
migrator:
103103
image:
104104
# -- Docker image tag for the `migrator` image
105-
defaultTag: 4.2.0@sha256:d816e125395e99d8a25564f5a799f0e9bedf7c6230065619849e169d0865a35e
105+
defaultTag: 187572_2022-12-06_cbecc5321c7d@sha256:93fc175df594738a98a62f2057271824cdb674b0e63bedac9dc7cb0f04db76bb
106106
# -- Docker image name for the `migrator` image
107107
name: "migrator"
108108
# -- Environment variables for the `migrator` container

charts/sourcegraph/README.md

Lines changed: 36 additions & 40 deletions
Large diffs are not rendered by default.

charts/sourcegraph/examples/basic/override.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ indexedSearch:
4040
cpu: "4"
4141
memory: 8G
4242

43-
minio:
43+
blobstore:
4444
resources:
4545
limits:
4646
cpu: "1"

charts/sourcegraph/examples/common-modifications/override.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ indexedSearchIndexer:
102102
cpu: "4"
103103
memory: 4G
104104

105-
minio:
105+
blobstore:
106106
resources:
107107
limits:
108108
cpu: "1"

charts/sourcegraph/examples/external-object-storage/override.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# - https://docs.sourcegraph.com/admin/install/kubernetes/helm#using-external-object-storage
44

55
# Disable deployment of the built-in object storage
6-
minio:
6+
blobstore:
77
enabled: false
88

99
# we use YAML anchors and alias to keep override file clean

charts/sourcegraph/templates/_helpers.tpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ app.kubernetes.io/name: jaeger
231231
{{- $checksum := list .Values.codeInsightsDB.auth -}}
232232
{{- $checksum = append $checksum .Values.codeIntelDB.auth -}}
233233
{{- $checksum = append $checksum .Values.pgsql.auth -}}
234-
{{- $checksum = append $checksum .Values.minio.auth -}}
235234
checksum/auth: {{ toJson $checksum | sha256sum }}
236235
{{- end -}}
237236

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{{- if .Values.blobstore.enabled -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
annotations:
6+
description: blobstore for storing LSIF uploads.
7+
labels:
8+
{{- include "sourcegraph.labels" . | nindent 4 }}
9+
{{- if .Values.blobstore.labels }}
10+
{{- toYaml .Values.blobstore.labels | nindent 4 }}
11+
{{- end }}
12+
deploy: sourcegraph
13+
app.kubernetes.io/component: blobstore
14+
name: {{ .Values.blobstore.name }}
15+
spec:
16+
minReadySeconds: 10
17+
replicas: 1
18+
revisionHistoryLimit: {{ .Values.sourcegraph.revisionHistoryLimit }}
19+
selector:
20+
matchLabels:
21+
{{- include "sourcegraph.selectorLabels" . | nindent 6 }}
22+
app: blobstore
23+
strategy:
24+
type: Recreate
25+
template:
26+
metadata:
27+
annotations:
28+
kubectl.kubernetes.io/default-container: blobstore
29+
{{- if .Values.sourcegraph.podAnnotations }}
30+
{{- toYaml .Values.sourcegraph.podAnnotations | nindent 8 }}
31+
{{- end }}
32+
{{- if .Values.blobstore.podAnnotations }}
33+
{{- toYaml .Values.blobstore.podAnnotations | nindent 8 }}
34+
{{- end }}
35+
labels:
36+
{{- include "sourcegraph.selectorLabels" . | nindent 8 }}
37+
{{- if .Values.sourcegraph.podLabels }}
38+
{{- toYaml .Values.sourcegraph.podLabels | nindent 8 }}
39+
{{- end }}
40+
{{- if .Values.blobstore.podLabels }}
41+
{{- toYaml .Values.blobstore.podLabels | nindent 8 }}
42+
{{- end }}
43+
deploy: sourcegraph
44+
app: blobstore
45+
spec:
46+
containers:
47+
- name: blobstore
48+
env:
49+
{{- range $name, $item := .Values.blobstore.env}}
50+
- name: {{ $name }}
51+
{{- $item | toYaml | nindent 10 }}
52+
{{- end }}
53+
image: {{ include "sourcegraph.image" (list . "blobstore") }}
54+
imagePullPolicy: {{ .Values.sourcegraph.image.pullPolicy }}
55+
args: {{- default (list "") .Values.blobstore.args | toYaml | nindent 8 }}
56+
terminationMessagePolicy: FallbackToLogsOnError
57+
ports:
58+
- containerPort: 9000
59+
name: blobstore
60+
livenessProbe:
61+
httpGet:
62+
path: /
63+
port: blobstore
64+
scheme: HTTP
65+
initialDelaySeconds: 60
66+
timeoutSeconds: 5
67+
readinessProbe:
68+
httpGet:
69+
path: /
70+
port: blobstore
71+
scheme: HTTP
72+
periodSeconds: 5
73+
timeoutSeconds: 5
74+
{{- if not .Values.sourcegraph.localDevMode }}
75+
resources:
76+
{{- toYaml .Values.blobstore.resources | nindent 10 }}
77+
{{- end }}
78+
securityContext:
79+
{{- toYaml .Values.blobstore.containerSecurityContext | nindent 10 }}
80+
volumeMounts:
81+
- name: blobstore-data
82+
mountPath: /data
83+
- name: blobstore
84+
mountPath: /blobstore
85+
{{- if .Values.blobstore.extraVolumeMounts }}
86+
{{- toYaml .Values.blobstore.extraVolumeMounts | nindent 8 }}
87+
{{- end }}
88+
{{- if .Values.blobstore.extraContainers }}
89+
{{- toYaml .Values.blobstore.extraContainers | nindent 6 }}
90+
{{- end }}
91+
securityContext:
92+
{{- toYaml .Values.blobstore.podSecurityContext | nindent 8 }}
93+
{{- include "sourcegraph.nodeSelector" (list . "blobstore" ) | trim | nindent 6 }}
94+
{{- include "sourcegraph.affinity" (list . "blobstore" ) | trim | nindent 6 }}
95+
{{- include "sourcegraph.tolerations" (list . "blobstore" ) | trim | nindent 6 }}
96+
{{- with .Values.sourcegraph.imagePullSecrets }}
97+
imagePullSecrets:
98+
{{- toYaml . | nindent 8 }}
99+
{{- end }}
100+
{{- include "sourcegraph.renderServiceAccountName" (list . "blobstore") | trim | nindent 6 }}
101+
volumes:
102+
- name: blobstore-data
103+
persistentVolumeClaim:
104+
claimName: blobstore
105+
- name: blobstore
106+
emptyDir: {}
107+
{{- if .Values.blobstore.extraVolumes }}
108+
{{- toYaml .Values.blobstore.extraVolumes | nindent 6 }}
109+
{{- end }}
110+
{{- end }}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.blobstore.enabled -}}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
labels:
6+
deploy: sourcegraph
7+
app.kubernetes.io/component: blobstore
8+
name: blobstore
9+
spec:
10+
accessModes:
11+
- ReadWriteOnce
12+
resources:
13+
requests:
14+
storage: {{ .Values.blobstore.storageSize }}
15+
storageClassName: {{ .Values.storageClass.name }}
16+
{{- if .Values.blobstore.volumeName }}
17+
volumeName: {{ .Values.blobstore.volumeName }}
18+
{{- end }}
19+
{{- end }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{- if .Values.blobstore.enabled -}}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
annotations:
6+
{{- if .Values.blobstore.serviceAnnotations }}
7+
{{- toYaml .Values.blobstore.serviceAnnotations | nindent 4 }}
8+
{{- end }}
9+
labels:
10+
app: blobstore
11+
deploy: sourcegraph
12+
app.kubernetes.io/component: blobstore
13+
{{- if .Values.blobstore.serviceLabels }}
14+
{{- toYaml .Values.blobstore.serviceLabels | nindent 4 }}
15+
{{- end }}
16+
name: blobstore
17+
spec:
18+
ports:
19+
- name: blobstore
20+
port: 9000
21+
targetPort: blobstore
22+
selector:
23+
{{- include "sourcegraph.selectorLabels" . | nindent 4 }}
24+
app: blobstore
25+
type: {{ .Values.blobstore.serviceType | default "ClusterIP" }}
26+
{{- end }}

0 commit comments

Comments
 (0)