Skip to content

Commit 854b3ae

Browse files
committed
feat(deployment): allow to configure TLS certificate for gRPC servers
The helm chart now allows to specify a sercret name where a TLS certificate and key are store. If specified, it mounts the secret in the pods and update the configuration to enable TLS on the servers. Signed-off-by: Christophe de Carvalho <christophe@archipelo.co>
1 parent 3fd5619 commit 854b3ae

File tree

5 files changed

+37
-1
lines changed

5 files changed

+37
-1
lines changed

deployment/chainloop/templates/cas/config.configmap.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ data:
1111
addr: 0.0.0.0:8000
1212
timeout: 1s
1313
grpc:
14+
{{- if .Values.cas.tlsConfig.secret }}
15+
tls_config:
16+
certificate: /data/server-certs/tls.crt
17+
private_key: /data/server-certs/tls.key
18+
{{- end }}
1419
addr: 0.0.0.0:9000
1520
timeout: 1s
1621
http_metrics:
17-
addr: 0.0.0.0:5000
22+
addr: 0.0.0.0:5000

deployment/chainloop/templates/cas/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ spec:
6262
- name: gcp-secretmanager-serviceaccountkey
6363
mountPath: /gcp-secrets
6464
{{- end }}
65+
{{- if .Values.cas.tlsConfig.secret }}
66+
- name: server-certs
67+
mountPath: /data/server-certs
68+
{{- end }}
6569
volumes:
6670
- name: config
6771
projected:
@@ -73,6 +77,11 @@ spec:
7377
- name: jwt-public-key
7478
secret:
7579
secretName: {{ include "chainloop.cas.fullname" . }}-jwt-public-key
80+
{{- if .Values.cas.tlsConfig.secret }}
81+
- name: server-certs
82+
secret:
83+
secretName: {{ .Values.cas.tlsConfig.secret }}
84+
{{- end }}
7685
{{- if eq "gcpSecretManager" .Values.secretsBackend.backend }}
7786
- name: gcp-secretmanager-serviceaccountkey
7887
secret:

deployment/chainloop/templates/controlplane/config.configmap.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ data:
2424
grpc:
2525
addr: 0.0.0.0:9000
2626
timeout: 10s
27+
{{- if .Values.cas.tlsConfig.secret }}
28+
tls_config:
29+
certificate: /data/server-certs/tls.crt
30+
private_key: /data/server-certs/tls.key
31+
{{- end }}
2732
cas_server:
2833
grpc:
2934
addr: {{ printf "%s-api:%.0f" (include "chainloop.cas.fullname" .) .Values.cas.serviceAPI.port }}

deployment/chainloop/templates/controlplane/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ spec:
8585
mountPath: /tmp
8686
- name: jwt-cas-private-key
8787
mountPath: /secrets
88+
{{- if .Values.controlplane.tlsConfig.secret }}
89+
- name: server-certs
90+
mountPath: /data/server-certs
91+
{{- end }}
8892
{{- if eq "gcpSecretManager" .Values.secretsBackend.backend }}
8993
- name: gcp-secretmanager-serviceaccountkey
9094
mountPath: /gcp-secrets
@@ -103,6 +107,11 @@ spec:
103107
- name: jwt-cas-private-key
104108
secret:
105109
secretName: {{ include "chainloop.controlplane.fullname" . }}-jwt-cas
110+
{{- if .Values.controlplane.tlsConfig.secret }}
111+
- name: server-certs
112+
secret:
113+
secretName: {{ .Values.controlplane.tlsConfig.secret }}
114+
{{- end }}
106115
{{- if eq "gcpSecretManager" .Values.secretsBackend.backend }}
107116
- name: gcp-secretmanager-serviceaccountkey
108117
secret:

deployment/chainloop/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ controlplane:
103103
# Overrides the image tag whose default is the chart appVersion.
104104
# tag: latest
105105

106+
## @param controlplane.tlsConfig.secret name of a secret containing TLS certificate to be used by the controlplane grpc server.
107+
tlsConfig:
108+
secret: ""
109+
106110
## @param controlplane.pluginsDir Directory where to look for plugins
107111
pluginsDir: /plugins
108112

@@ -443,6 +447,10 @@ cas:
443447
# Overrides the image tag whose default is the chart appVersion.
444448
# tag: latest
445449

450+
## @param cas.tlsConfig.secret name of a secret containing TLS certificate to be used by the controlplane grpc server.
451+
tlsConfig:
452+
secret: ""
453+
446454
## @skip cas.serviceAccount
447455
serviceAccount:
448456
# Specifies whether a service account should be created

0 commit comments

Comments
 (0)