Skip to content

Commit 31b4c42

Browse files
committed
Support custom CA certificates in Helm
1 parent 5dafe5c commit 31b4c42

13 files changed

+118
-0
lines changed

chart/templates/_helpers.tpl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,39 @@ storage:
357357
{{- end -}}
358358
{{- end -}}
359359

360+
{{/* custom ca bundle volume and volumeMount */}}
361+
{{- define "gitpod.caBundleVolume" -}}
362+
{{- if .Values.fullCABundleSecretName -}}
363+
- name: ca-bundle-certs
364+
secret:
365+
secretName: {{ .Values.fullCABundleSecretName }}
366+
{{- end -}}
367+
{{- end -}}
368+
369+
{{- define "gitpod.caBundleVolumeMount" -}}
370+
{{- if .Values.fullCABundleSecretName -}}
371+
- name: ca-bundle-certs
372+
mountPath: /etc/ssl/certs/ca-certificates.crt
373+
subPath: ca-certificates.crt
374+
{{- end -}}
375+
{{- end -}}
376+
377+
{{- define "gitpod.extraCABundleVolume" -}}
378+
{{- if .Values.extraCABundleSecretName -}}
379+
- name: extra-certs
380+
secret:
381+
secretName: {{ .Values.extraCABundleSecretName }}
382+
{{- end -}}
383+
{{- end -}}
384+
385+
{{- define "gitpod.extraCABundleVolumeMount" -}}
386+
{{- if .Values.extraCABundleSecretName -}}
387+
- name: extra-certs
388+
mountPath: /etc/ssl/certs/extra/ca-certificates.crt
389+
subPath: ca-certificates.crt
390+
{{- end -}}
391+
{{- end -}}
392+
360393
{{- define "gitpod.kube-rbac-proxy" -}}
361394
- name: kube-rbac-proxy
362395
image: quay.io/brancz/kube-rbac-proxy:v0.11.0

chart/templates/blobserve-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ spec:
6565
mountPath: /mnt/pull-secret.json
6666
subPath: .dockerconfigjson
6767
{{- end }}
68+
{{- if .Values.fullCABundleSecretName }}
69+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
70+
{{- end }}
6871
{{ include "gitpod.kube-rbac-proxy" $this | indent 6 }}
6972
volumes:
7073
- name: cache
@@ -77,5 +80,8 @@ spec:
7780
secret:
7881
secretName: {{ .Values.components.workspace.pullSecret.secretName }}
7982
{{- end }}
83+
{{- if .Values.fullCABundleSecretName }}
84+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
85+
{{- end }}
8086
{{ toYaml .Values.defaults | indent 6 }}
8187
{{ end }}

chart/templates/content-service-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,19 @@ spec:
6161
- name: config
6262
mountPath: "/config"
6363
readOnly: true
64+
{{- if .Values.fullCABundleSecretName }}
65+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
66+
{{- end }}
6467
{{- if $comp.volumeMounts }}
6568
{{ toYaml $comp.volumeMounts | indent 8 }}
6669
{{- end }}
6770
volumes:
6871
- name: config
6972
configMap:
7073
name: {{ template "gitpod.comp.configMap" $this }}
74+
{{- if .Values.fullCABundleSecretName }}
75+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
76+
{{- end }}
7177
{{- if $comp.volumes }}
7278
{{ toYaml $comp.volumes | indent 6 }}
7379
{{- end }}

chart/templates/image-builder-deployment.yaml

Lines changed: 9 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.fullCABundleSecretName }}
68+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
69+
{{- end }}
6770
enableServiceLinks: false
6871
containers:
6972
- name: dind
@@ -80,6 +83,9 @@ spec:
8083
- mountPath: /etc/docker/certs.d/{{- if eq $sec.name "builtin" -}}{{ template "gitpod.builtinRegistry.name" $this.root }}{{ else }}{{ $sec.name }}{{ end }}
8184
name: docker-tls-certs-{{ $idx }}
8285
{{- end }}
86+
{{- if .Values.fullCABundleSecretName }}
87+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
88+
{{- end }}
8389
{{- if $comp.dindResources }}
8490
resources:
8591
{{ toYaml $comp.dindResources | indent 10 }}
@@ -105,6 +111,9 @@ spec:
105111
name: pull-secret
106112
{{- end }}
107113
{{- end }}
114+
{{- if .Values.fullCABundleSecretName }}
115+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
116+
{{- end }}
108117
resources:
109118
requests:
110119
cpu: {{ $.Values.resources.default.cpu }}

chart/templates/image-builder-mk3-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ spec:
6060
- name: wsman-tls-certs
6161
secret:
6262
secretName: {{ .Values.components.wsManager.tls.server.secretName }}
63+
{{- if .Values.fullCABundleSecretName }}
64+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
65+
{{- end }}
6366
enableServiceLinks: false
6467
containers:
6568
{{ include "gitpod.kube-rbac-proxy" $this | indent 6 }}
@@ -86,6 +89,9 @@ spec:
8689
name: pull-secret
8790
{{- end }}
8891
{{- end }}
92+
{{- if .Values.fullCABundleSecretName }}
93+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
94+
{{- end }}
8995
resources:
9096
requests:
9197
cpu: {{ $.Values.resources.default.cpu }}

chart/templates/proxy-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ spec:
105105
{{- end }}
106106
- name: config-certificates
107107
mountPath: "/etc/caddy/certificates"
108+
{{- if .Values.fullCABundleSecretName }}
109+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
110+
{{- end }}
108111
{{ include "gitpod.container.defaultEnv" (dict "root" . "gp" $.Values "comp" $comp) | indent 8 }}
109112
- name: PROXY_DOMAIN
110113
value: "{{ $.Values.hostname }}"
@@ -123,5 +126,8 @@ spec:
123126
- name: config-certificates
124127
secret:
125128
secretName: {{ $.Values.certificatesSecret.secretName }}
129+
{{- if .Values.fullCABundleSecretName }}
130+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
131+
{{- end }}
126132
{{ toYaml .Values.defaults | indent 6 }}
127133
{{ end }}

chart/templates/registry-facade-daemonset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ spec:
7171
- name: https-certificates
7272
mountPath: "/mnt/certificates"
7373
{{- end }}
74+
{{- if .Values.fullCABundleSecretName }}
75+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
76+
{{- end }}
7477
{{ include "gitpod.kube-rbac-proxy" $this | indent 6 }}
7578
volumes:
7679
- name: cache
@@ -91,5 +94,8 @@ spec:
9194
secret:
9295
secretName: {{ .Values.certificatesSecret.secretName }}
9396
{{- end }}
97+
{{- if .Values.fullCABundleSecretName }}
98+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
99+
{{- end }}
94100
{{ toYaml .Values.defaults | indent 6 }}
95101
{{ end }}

chart/templates/server-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ spec:
105105
mountPath: "{{ dir $comp.githubApp.certPath }}"
106106
readOnly: true
107107
{{- end }}
108+
{{- if .Values.fullCABundleSecretName }}
109+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
110+
{{- end }}
108111
{{- if $comp.serverContainer.volumeMounts }}
109112
{{ toYaml $comp.serverContainer.volumeMounts | indent 8 }}
110113
{{- end }}
@@ -145,5 +148,8 @@ spec:
145148
{{- if $comp.volumes }}
146149
{{ toYaml $comp.volumes | indent 6 }}
147150
{{- end }}
151+
{{- if .Values.fullCABundleSecretName }}
152+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
153+
{{- end }}
148154
{{ toYaml .Values.defaults | indent 6 }}
149155
{{ end }}

chart/templates/ws-daemon-daemonset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ spec:
100100
{{- end }}
101101
{{- if $comp.volumes }}
102102
{{ toYaml $comp.volumes | indent 6 }}
103+
{{- end }}
104+
{{- if .Values.fullCABundleSecretName }}
105+
{{ include "gitpod.caBundleVolume" . | indent 6 }}
103106
{{- end }}
104107
enableServiceLinks: false
105108
{{- if (or $comp.userNamespaces.shiftfsModuleLoader.enabled $comp.userNamespaces.seccompProfileInstaller.enabled) }}
@@ -267,6 +270,9 @@ spec:
267270
name: tls-certs
268271
{{- if $comp.volumeMounts }}
269272
{{ toYaml $comp.volumeMounts | indent 8 }}
273+
{{- end }}
274+
{{- if .Values.fullCABundleSecretName }}
275+
{{ include "gitpod.caBundleVolumeMount" . | indent 8 }}
270276
{{- end }}
271277
args: ["run", "--config", "/config/config.json"]
272278
image: {{ template "gitpod.comp.imageFull" $this }}

chart/templates/ws-manager-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ spec:
5656
- name: workspace-template
5757
configMap:
5858
name: workspace-template
59+
{{- if .Values.extraCABundleSecretName }}
60+
{{ include "gitpod.extraCABundleVolume" . | indent 6 }}
61+
{{- end }}
5962
{{- if $comp.volumes }}
6063
{{ toYaml $comp.volumes | indent 6 }}
6164
{{- end }}
@@ -81,6 +84,9 @@ spec:
8184
- mountPath: /certs
8285
name: tls-certs
8386
readOnly: true
87+
{{- if .Values.extraCABundleSecretName }}
88+
{{ include "gitpod.extraCABundleVolumeMount" . | indent 8 }}
89+
{{- end }}
8490
{{- if $comp.volumeMounts }}
8591
{{ toYaml $comp.volumeMounts | indent 8 }}
8692
{{- end }}

0 commit comments

Comments
 (0)