Skip to content

Commit 06fdc00

Browse files
committed
first attempt to add custom certificates
1 parent ff3c0ed commit 06fdc00

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
---
12
apiVersion: v1
23
kind: ConfigMap
34
metadata:
45
name: {{ printf "%s-certificates" (include "geohealthcheck.fullname" .) | squote }}
56
labels:
67
{{- include "geohealthcheck.labels" . | nindent 4 }}
78
data:
8-
my-ca.crt: |
9-
-----BEGIN CERTIFICATE-----
10-
MIID... (your certificate content here)
11-
-----END CERTIFICATE-----
9+
{{- range $filename, $certificate := .Values.additionalCertificates }}
10+
{{ $filename -}}: >-
11+
{{- $certificate | nindent 4 }}
12+
{{- end -}}

helmchart/geohealthcheck/templates/deployment.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
initContainers:
3232
- name: update-ca-certificates
3333
image: '{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}'
34-
command: ['sh', '-c', 'cp /custom-ca/my-ca.crt /usr/local/share/ca-certificates/ && update-ca-certificates']
34+
command: ['sh', '-c', 'cp /custom-ca/* /usr/local/share/ca-certificates/ && update-ca-certificates']
3535
volumeMounts:
3636
- name: custom-ca-cert
3737
mountPath: /custom-ca
@@ -51,12 +51,18 @@ spec:
5151
{{- toYaml .Values.readinessProbe | nindent 12 }}
5252
resources:
5353
{{- toYaml .Values.resources | nindent 12 }}
54-
{{- with .Values.volumeMounts }}
5554
volumeMounts:
55+
# TODO: loop through certs
56+
- name: custom-ca-cert
57+
mountPath: /etc/ssl/certs/my-ca.crt
58+
{{- with .Values.volumeMounts }}
5659
{{- toYaml . | nindent 12 }}
5760
{{- end }}
58-
{{- with .Values.volumes }}
5961
volumes:
62+
- name: custom-ca-cert
63+
configMap:
64+
name: custom-ca-cert
65+
{{- with .Values.volumes }}
6066
{{- toYaml . | nindent 8 }}
6167
{{- end }}
6268
{{- with .Values.nodeSelector }}

helmchart/geohealthcheck/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ service:
141141
# https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
142142
type: 'ClusterIP'
143143

144+
additionalCertificates:
145+
cert1.crt: |
146+
-----BEGIN CERTIFICATE-----
147+
MIID... (your certificate content here)
148+
-----END CERTIFICATE-----
149+
cert2.crt: |
150+
-----BEGIN CERTIFICATE-----
151+
MIID... (your certificate content here)
152+
-----END CERTIFICATE-----
153+
144154
# This block is for setting up the ingress for more information can be found
145155
# here: https://kubernetes.io/docs/concepts/services-networking/ingress/
146156
ingress:

0 commit comments

Comments
 (0)