Skip to content

Commit 5930420

Browse files
committed
Support custom CA certificates in Helm
Signed-off-by: jgallucci32 <[email protected]>
1 parent e7df212 commit 5930420

6 files changed

+48
-0
lines changed

chart/templates/_helpers.tpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ data:
319319
{{- end -}}
320320
{{- end -}}
321321

322+
<<<<<<< HEAD
322323
{{- define "gitpod.remoteStorage.config" -}}
323324
{{- $ := .root -}}
324325
{{- $remoteStorageMinio := .remoteStorage.minio | default dict -}}
@@ -339,4 +340,17 @@ storage:
339340
{{- else }}
340341
{{ toYaml .remoteStorage | indent 2 }}
341342
{{- end -}}
343+
=======
344+
{{/* custom ca bundle volume and volumeMount */}}
345+
{{- define "gitpod.caBundleVolume" -}}
346+
- name: ca-bundle-certs
347+
secret:
348+
secretName: {{ .Values.caBundleSecretName }}
349+
{{- end -}}
350+
351+
{{- define "gitpod.caBundleVolumeMount" -}}
352+
- name: ca-bundle-certs
353+
mountPath: /etc/ssl/certs/ca-certificates.crt
354+
subPath: ca-certificates.crt
355+
>>>>>>> 3cae036 (Support custom CA certificates in Helm)
342356
{{- end -}}

chart/templates/blobserve-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ spec:
6969
mountPath: /mnt/pull-secret.json
7070
subPath: .dockerconfigjson
7171
{{- end }}
72+
{{- if .Values.caBundleSecretName }}
73+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
74+
{{- end }}
7275
volumes:
7376
- name: cache
7477
emptyDir: {}
@@ -80,5 +83,8 @@ spec:
8083
secret:
8184
secretName: {{ .Values.components.workspace.pullSecret.secretName }}
8285
{{- end }}
86+
{{- if .Values.caBundleSecretName }}
87+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
88+
{{- end }}
8389
{{ toYaml .Values.defaults | indent 6 }}
8490
{{ end }}

chart/templates/image-builder-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ spec:
6464
secret:
6565
secretName: {{ $sec.secret }}
6666
{{- end }}
67+
{{- if .Values.caBundleSecretName }}
68+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
69+
{{- end }}
6770
containers:
6871
- name: dind
6972
image: {{ $comp.dindImage | default "docker:19.03-dind" }}
@@ -78,6 +81,9 @@ spec:
7881
{{- range $idx, $sec := $comp.registryCerts }}
7982
- mountPath: /etc/docker/certs.d/{{- if eq $sec.name "builtin" -}}{{ template "gitpod.builtinRegistry.name" $this.root }}{{ else }}{{ $sec.name }}{{ end }}
8083
name: docker-tls-certs-{{ $idx }}
84+
{{- if .Values.caBundleSecretName }}
85+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
86+
{{- end }}
8187
{{- end }}
8288
{{- if $comp.dindResources }}
8389
resources:

chart/templates/registry-facade-daemonset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ spec:
9797
- name: https-certificates
9898
mountPath: "/mnt/certificates"
9999
{{- end }}
100+
{{- if .Values.caBundleSecretName }}
101+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
102+
{{- end }}
100103
volumes:
101104
- name: cache
102105
emptyDir: {}
@@ -132,5 +135,8 @@ spec:
132135
path: privkey.pem
133136
{{- end }}
134137
{{- end }}
138+
{{- if .Values.caBundleSecretName }}
139+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
140+
{{- end }}
135141
{{ toYaml .Values.defaults | indent 6 }}
136142
{{ end }}

chart/templates/server-deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ spec:
8181
{{- if $comp.serverContainer.volumeMounts }}
8282
{{ toYaml $comp.serverContainer.volumeMounts | indent 8 }}
8383
{{- end }}
84+
{{- if .Values.caBundleSecretName }}
85+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
86+
{{- end }}
8487
{{ include "gitpod.container.defaultEnv" $this | indent 8 }}
8588
{{ include "gitpod.container.dbEnv" $this | indent 8 }}
8689
{{ include "gitpod.container.tracingEnv" $this | indent 8 }}
@@ -213,6 +216,10 @@ spec:
213216
value: {{ $comp.garbageCollection.disabled | default "false" | quote }}
214217
{{- if $comp.serverContainer.env }}
215218
{{ toYaml $comp.serverContainer.env | indent 8 }}
219+
{{- end }}
220+
{{- if .Values.caBundleSecretName }}
221+
- name: NODE_EXTRA_CA_CERTS
222+
value: /etc/ssl/certs/ca-certificates.crt
216223
{{- end }}
217224
volumes:
218225
{{- if $comp.storage.secretName }}
@@ -228,5 +235,8 @@ spec:
228235
{{- if $comp.volumes }}
229236
{{ toYaml $comp.volumes | indent 6 }}
230237
{{- end }}
238+
{{- if .Values.caBundleSecretName }}
239+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
240+
{{- end }}
231241
{{ toYaml .Values.defaults | indent 6 }}
232242
{{ end }}

chart/templates/ws-daemon-daemonset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ spec:
105105
{{- if $comp.volumes }}
106106
{{ toYaml $comp.volumes | indent 6 }}
107107
{{- end }}
108+
{{- if .Values.caBundleSecretName }}
109+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
110+
{{- end }}
108111
{{- if (or $comp.userNamespaces.shiftfsModuleLoader.enabled $comp.userNamespaces.seccompProfileInstaller.enabled) }}
109112
initContainers:
110113
{{- end }}
@@ -155,6 +158,9 @@ spec:
155158
name: tls-certs
156159
{{- if $comp.volumeMounts }}
157160
{{ toYaml $comp.volumeMounts | indent 8 }}
161+
{{- end }}
162+
{{- if .Values.caBundleSecretName }}
163+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
158164
{{- end }}
159165
args: ["run", "-v", "--config", "/config/config.json"]
160166
image: {{ template "gitpod.comp.imageFull" $this }}

0 commit comments

Comments
 (0)