Skip to content

Commit 858cf4f

Browse files
committed
fix(deployment): properly expose service account key for secret manager
We need to mount the service account key as a file into the controlplane container when using GCP secret manager. Signed-off-by: Christophe de Carvalho <christophe@archipelo.co>
1 parent f6ec84d commit 858cf4f

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

deployment/chainloop/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ awsSecretManager:
8282
gcpSecretManager:
8383
secretPrefix: {{ required "secret prefix required" .secretPrefix | quote }}
8484
projectId: {{ required "project id required" .gcpSecretManager.projectId | quote }}
85-
authKey: {{ required "auth key required" .gcpSecretManager.authKey | quote }}
85+
authKey: "/gcp-secrets/authKey.json"
8686

8787
{{- end }}
8888
{{- end }}

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 eq "gcpSecretManager" .Values.secretsBackend.backend }}
89+
- name: gcp-secretmanager-authkey
90+
mountPath: /gcp-secrets
91+
{{- end }}
8892
volumes:
8993
- name: config
9094
projected:
@@ -99,3 +103,8 @@ spec:
99103
- name: jwt-cas-private-key
100104
secret:
101105
secretName: {{ include "chainloop.controlplane.fullname" . }}-jwt-cas
106+
{{- if eq "gcpSecretManager" .Values.secretsBackend.backend }}
107+
- name: gcp-secretmanager-authkey
108+
secret:
109+
secretName: {{ include "chainloop.controlplane.fullname" . }}-gcp-secretmanager-authkey
110+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if eq "gcpSecretManager" .Values.secretsBackend.backend }}
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: {{ include "chainloop.controlplane.fullname" . }}-gcp-secretmanager-authkey
6+
labels:
7+
{{- include "chainloop.controlplane.labels" . | nindent 4 }}
8+
type: Opaque
9+
data:
10+
authKey.json: {{ .Values.secretsBackend.gcpSecretManager.authKey | b64enc | quote }}
11+
{{- end }}

0 commit comments

Comments
 (0)