Skip to content

Commit aa327dc

Browse files
author
Craig Furman
authored
feat(appliance): airgap fallback (#532)
Requires the admin to create a particular configmap first: ``` kubectl create configmap pinned-releases --from-file releases.json ``` `releases.json` must be formed like a release registry response, the same schema as what is returned by `curl https://releaseregistry.sourcegraph.com/v1/releases/sourcegraph`.
1 parent 2d070a6 commit aa327dc

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

charts/sourcegraph-appliance/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ In addition to the documented values, all services also support the following va
2929
| Key | Type | Default | Description |
3030
|-----|------|---------|-------------|
3131
| affinity | object | `{}` | |
32+
| airgap.enabled | bool | `false` | |
3233
| frontend.image.image | string | `"appliance-frontend"` | |
3334
| frontend.image.tag | string | `"5.5.3738"` | |
3435
| fullnameOverride | string | `""` | |
@@ -66,5 +67,3 @@ In addition to the documented values, all services also support the following va
6667
| serviceAccount.create | bool | `true` | |
6768
| serviceAccount.name | string | `"sourcegraph-appliance"` | |
6869
| tolerations | list | `[]` | |
69-
| volumeMounts | list | `[]` | |
70-
| volumes | list | `[]` | |

charts/sourcegraph-appliance/templates/deployment.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,29 @@ spec:
5252
- name: APPLIANCE_NO_RESOURCE_RESTRICTIONS
5353
value: "true"
5454
{{- end }}
55+
{{- if .Values.airgap.enabled }}
56+
- name: APPLIANCE_PINNED_RELEASES_FILE
57+
value: /etc/releases/releases.json
58+
{{- end }}
5559
ports:
5660
- name: http
5761
containerPort: 8888
5862
protocol: TCP
5963
resources:
6064
{{- toYaml .Values.resources | nindent 12 }}
61-
{{- with .Values.volumeMounts }}
65+
{{- if .Values.airgap.enabled }}
6266
volumeMounts:
63-
{{- toYaml . | nindent 12 }}
67+
- name: releases
68+
mountPath: /etc/releases
6469
{{- end }}
65-
{{- with .Values.volumes }}
70+
{{- if .Values.airgap.enabled }}
6671
volumes:
67-
{{- toYaml . | nindent 8 }}
72+
- name: releases
73+
configMap:
74+
name: pinned-releases
75+
items:
76+
- key: releases.json
77+
path: releases.json
6878
{{- end }}
6979
{{- with .Values.nodeSelector }}
7080
nodeSelector:

charts/sourcegraph-appliance/values.yaml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,6 @@ readinessProbe:
9292
path: /
9393
port: http
9494

95-
# Additional volumes on the output Deployment definition.
96-
volumes: []
97-
# - name: foo
98-
# secret:
99-
# secretName: mysecret
100-
# optional: false
101-
102-
# Additional volumeMounts on the output Deployment definition.
103-
volumeMounts: []
104-
# - name: foo
105-
# mountPath: "/etc/foo"
106-
# readOnly: true
107-
10895
nodeSelector: {}
10996

11097
tolerations: []
@@ -123,3 +110,6 @@ selfUpdate:
123110
# Set to true to remove all resource requests and limits from the deployed SG.
124111
# Only recommended for development use.
125112
noResourceRestrictions: false
113+
114+
airgap:
115+
enabled: false

0 commit comments

Comments
 (0)