Skip to content

Commit 6f7e079

Browse files
authored
feat(deployment): Add support for GCP secret manager to Helm charts (#225)
Signed-off-by: Rafał Kuć <r.kuc@solr.pl>
1 parent 1267bdf commit 6f7e079

File tree

4 files changed

+58
-15
lines changed

4 files changed

+58
-15
lines changed

deployment/chainloop/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Chainloop is an open source software supply chain control plane, a
44

55
type: application
66
# Bump the patch (not minor, not major) version on each change in the Chart Source code
7-
version: 1.8.1
7+
version: 1.8.2
88
# Do not update appVersion, this is handled automatically by the release process
99
appVersion: v0.13.0
1010

@@ -21,4 +21,4 @@ dependencies:
2121
- condition: development
2222
name: vault
2323
repository: https://helm.releases.hashicorp.com
24-
version: 0.24.x
24+
version: 0.24.x

deployment/chainloop/README.md

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,20 @@ helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
8989
# ...
9090
```
9191

92+
Deploy using GCP secret manager instead of Vault
93+
94+
```console
95+
helm install [RELEASE_NAME] oci://ghcr.io/chainloop-dev/charts/chainloop \
96+
# Open ID Connect (OIDC)
97+
# ...
98+
# Secrets backend
99+
--set secretsBackend.backend=gcpSecretManager \
100+
--set secretsBackend.gcpSecretManager.projectId=[GCP Project ID] \
101+
--set secretsBackend.gcpSecretManager.authKey=[GCP Auth KEY] \
102+
# Server Auth KeyPair
103+
# ...
104+
```
105+
92106
Connect to an external PostgreSQL database instead
93107

94108
```console
@@ -292,6 +306,19 @@ secretsBackend:
292306
secretKey: [SECRET]
293307
region: [REGION]
294308
```
309+
310+
### Use GCP secret manager
311+
312+
You can swap the secret manager backend with the following settings
313+
314+
```yaml
315+
secretsBackend:
316+
backend: gcpSecretManager
317+
gcpSecretManager:
318+
projectId: [PROJECT_ID]
319+
authKey: [KEY]
320+
```
321+
295322
### Send exceptions to Sentry
296323

297324
```yaml
@@ -332,15 +359,17 @@ chainloop config save \
332359
333360
### Secrets Backend
334361
335-
| Name | Description | Value |
336-
| ------------------------------------------- | -------------------------------------------------------------------- | ----------- |
337-
| `secretsBackend.backend` | Secrets backend type ("vault" or "awsSecretManager") | `vault` |
338-
| `secretsBackend.secretPrefix` | Prefix that will be pre-pended to all secrets in the storage backend | `chainloop` |
339-
| `secretsBackend.vault.address` | Vault address | |
340-
| `secretsBackend.vault.token` | Vault authentication token | |
341-
| `secretsBackend.awsSecretManager.accessKey` | AWS Access KEY ID | |
342-
| `secretsBackend.awsSecretManager.secretKey` | AWS Secret Key | |
343-
| `secretsBackend.awsSecretManager.region` | AWS Secret Manager Region | |
362+
| Name | Description | Value |
363+
| ------------------------------------------- | --------------------------------------------------------------------- | ----------- |
364+
| `secretsBackend.backend` | Secrets backend type ("vault", "awsSecretManager", "gcpSecretManager")| `vault` |
365+
| `secretsBackend.secretPrefix` | Prefix that will be pre-pended to all secrets in the storage backend | `chainloop` |
366+
| `secretsBackend.vault.address` | Vault address | |
367+
| `secretsBackend.vault.token` | Vault authentication token | |
368+
| `secretsBackend.awsSecretManager.accessKey` | AWS Access KEY ID | |
369+
| `secretsBackend.awsSecretManager.secretKey` | AWS Secret Key | |
370+
| `secretsBackend.awsSecretManager.region` | AWS Secret Manager Region | |
371+
| `secretsBackend.gcpSecretManager.projectId` | GCP Project ID | |
372+
| `secretsBackend.gcpSecretManager.authKey` | GCP Auth Key | |
344373
345374
### Authentication
346375
@@ -508,4 +537,4 @@ Unless required by applicable law or agreed to in writing, software
508537
distributed under the License is distributed on an "AS IS" BASIS,
509538
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
510539
See the License for the specific language governing permissions and
511-
limitations under the License.
540+
limitations under the License.

deployment/chainloop/templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ awsSecretManager:
7777
creds:
7878
accessKey: {{ required "access key required" .awsSecretManager.accessKey | quote }}
7979
secretKey: {{ required "secret key required" .awsSecretManager.secretKey | quote }}
80+
81+
{{- else if eq .backend "gcpSecretManager" }}
82+
gcpSecretManager:
83+
secretPrefix: {{ required "secret prefix required" .secretPrefix | quote }}
84+
projectId: {{ required "project id required" .gcpSecretManager.projectId | quote }}
85+
authKey: {{ required "auth key required" .gcpSecretManager.authKey | quote }}
86+
8087
{{- end }}
8188
{{- end }}
8289
{{- end -}}

deployment/chainloop/values.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ sentry:
3030

3131
## Location where to store sensitive data. If development.true? and no overrides provided, the setup will connect to a development instance of Vault
3232
secretsBackend:
33-
## @param secretsBackend.backend Secrets backend type ("vault" or "awsSecretManager")
33+
## @param secretsBackend.backend Secrets backend type ("vault", "awsSecretManager" or "gcpSecretManager")
3434
##
3535
backend: "vault" # "awsSecretManager"
3636
## @param secretsBackend.secretPrefix Prefix that will be pre-pended to all secrets in the storage backend
3737
##
3838
secretPrefix: "chainloop"
3939

40-
# Either vault or AWS secret manager enabled at the same time
40+
# Either vault, AWS secret manager or GCP secret manager enabled at the same time
4141
## @extra secretsBackend.vault.address Vault address
4242
## @extra secretsBackend.vault.token Vault authentication token
4343
##
@@ -54,6 +54,13 @@ secretsBackend:
5454
# secretKey: ""
5555
# region: ""
5656

57+
## @extra secretsBackend.gcpSecretManager.projectId GCP Project ID
58+
## @extra secretsBackend.gcpSecretManager.authKey GCP Auth Key
59+
##
60+
# gcpSecretManager:
61+
# projectId: ""
62+
# authKey: ""
63+
5764
## @section Authentication
5865
##
5966

@@ -632,4 +639,4 @@ vault:
632639
server:
633640
dev:
634641
enabled: true
635-
devRootToken: "notapassword"
642+
devRootToken: "notapassword"

0 commit comments

Comments
 (0)