Skip to content

Commit 85f082d

Browse files
authored
feat(cas): Allow custom CAs in CAS deployment (#1078)
Signed-off-by: Jose I. Paris <[email protected]>
1 parent f88c8ed commit 85f082d

File tree

5 files changed

+54
-17
lines changed

5 files changed

+54
-17
lines changed

deployment/chainloop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Chainloop is an open source software supply chain control plane, a
77

88
type: application
99
# Bump the patch (not minor, not major) version on each change in the Chart Source code
10-
version: 1.75.0
10+
version: 1.75.1
1111
# Do not update appVersion, this is handled automatically by the release process
1212
appVersion: v0.93.5
1313

deployment/chainloop/README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ controlplane:
401401

402402
### Insert custom Certificate Authorities (CAs)
403403

404-
In some scenarios, you might want to add custom Certificate Authorities to the Chainloop deployment. Like in the instance where your OIDC provider uses a self-signed certificate. To do so, add the PEM-encoded CA certificate to the `customCAs` list in your `values.yaml` file like in the example below.
404+
In some scenarios, you might want to add custom Certificate Authorities to the Chainloop deployment. Like in the instance where your OIDC provider uses a self-signed certificate. To do so, add the PEM-encoded CA certificate to the `customCAs` list in either `controlplane` or `cas` sections, in your `values.yaml` file like in the example below.
405405

406406
```yaml
407407
customCAs:
@@ -655,20 +655,21 @@ chainloop config save \
655655

656656
### CAS Misc
657657

658-
| Name | Description | Value |
659-
| --------------------------------------------------- | ---------------------------------- | ------------ |
660-
| `cas.resources.limits.cpu` | Container resource limits CPU | `250m` |
661-
| `cas.resources.limits.memory` | Container resource limits memory | `512Mi` |
662-
| `cas.resources.requests.cpu` | Container resource requests CPU | `250m` |
663-
| `cas.resources.requests.memory` | Container resource requests memory | `512Mi` |
664-
| `cas.autoscaling.enabled` | Enable deployment autoscaling | `false` |
665-
| `cas.autoscaling.minReplicas` | Minimum number of replicas | `1` |
666-
| `cas.autoscaling.maxReplicas` | Maximum number of replicas | `100` |
667-
| `cas.autoscaling.targetCPUUtilizationPercentage` | Target CPU percentage | `80` |
668-
| `cas.autoscaling.targetMemoryUtilizationPercentage` | Target CPU memory | `80` |
669-
| `cas.sentry.enabled` | Enable sentry.io alerting | `false` |
670-
| `cas.sentry.dsn` | DSN endpoint | `""` |
671-
| `cas.sentry.environment` | Environment tag | `production` |
658+
| Name | Description | Value |
659+
| --------------------------------------------------- | -------------------------------------- | ------------ |
660+
| `cas.resources.limits.cpu` | Container resource limits CPU | `250m` |
661+
| `cas.resources.limits.memory` | Container resource limits memory | `512Mi` |
662+
| `cas.resources.requests.cpu` | Container resource requests CPU | `250m` |
663+
| `cas.resources.requests.memory` | Container resource requests memory | `512Mi` |
664+
| `cas.autoscaling.enabled` | Enable deployment autoscaling | `false` |
665+
| `cas.autoscaling.minReplicas` | Minimum number of replicas | `1` |
666+
| `cas.autoscaling.maxReplicas` | Maximum number of replicas | `100` |
667+
| `cas.autoscaling.targetCPUUtilizationPercentage` | Target CPU percentage | `80` |
668+
| `cas.autoscaling.targetMemoryUtilizationPercentage` | Target CPU memory | `80` |
669+
| `cas.sentry.enabled` | Enable sentry.io alerting | `false` |
670+
| `cas.sentry.dsn` | DSN endpoint | `""` |
671+
| `cas.sentry.environment` | Environment tag | `production` |
672+
| `cas.customCAs` | List of custom CA certificates content | `[]` |
672673

673674
### Dependencies
674675

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{- /*
2+
Copyright Chainloop, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- $customCAs := .Values.cas.customCAs }}
7+
{{- if (not (empty $customCAs)) }}
8+
apiVersion: v1
9+
kind: Secret
10+
metadata:
11+
name: {{ include "chainloop.cas.fullname" . }}-custom-cas
12+
labels:
13+
{{- include "chainloop.cas.labels" . | nindent 4 }}
14+
data:
15+
{{- range $index, $pem := $customCAs }}
16+
custom-{{ $index }}.crt: {{ $pem | b64enc | quote }}
17+
{{- end -}}
18+
{{- end -}}

deployment/chainloop/templates/cas/deployment.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ spec:
7171
- name: server-certs
7272
mountPath: /data/server-certs
7373
{{- end }}
74+
{{- if (not (empty .Values.cas.customCAs)) }}
75+
- name: custom-cas
76+
# NOTE: /etc/ssl/certs already contains the system CA certs
77+
# Let's use another known path https://go.dev/src/crypto/x509/root_linux.go
78+
mountPath: /etc/pki/tls/certs
79+
readOnly: true
80+
{{- end }}
7481
volumes:
7582
- name: config
7683
projected:
@@ -91,4 +98,11 @@ spec:
9198
- name: gcp-secretmanager-serviceaccountkey
9299
secret:
93100
secretName: {{ include "chainloop.controlplane.fullname" . }}-gcp-secretmanager-serviceaccountkey
94-
{{- end }}
101+
{{- end }}
102+
{{- if (not (empty .Values.cas.customCAs)) }}
103+
- name: custom-cas
104+
projected:
105+
sources:
106+
- secret:
107+
name: {{ include "chainloop.cas.fullname" . }}-custom-cas
108+
{{- end }}

deployment/chainloop/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,10 @@ cas:
824824
dsn: ""
825825
environment: production
826826

827+
## Inject custom CA certificates to the CAS container
828+
## @param cas.customCAs List of custom CA certificates content
829+
customCAs: []
830+
827831
## @section Dependencies
828832
# ##################################
829833
# # Dependencies #

0 commit comments

Comments
 (0)