Skip to content

Commit 1f5c9d3

Browse files
feat: Add support for custom Root CA configuration in Helm chart (#129)
* feat: Add support for custom Root CA configuration in Helm chart * fix: Remove default value for customRootCA in Helm chart
1 parent d27b885 commit 1f5c9d3

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

deploy/helm/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,29 @@ Then open `http://localhost:4005` in your browser.
3232
| `image.pullPolicy` | Image pull policy | `Always` |
3333
| `replicaCount` | Number of replicas | `1` |
3434

35+
### Custom Root CA
36+
37+
| Parameter | Description | Default Value |
38+
| -------------- | ---------------------------------------- | ------------- |
39+
| `customRootCA` | Name of Secret containing CA certificate | `""` |
40+
41+
To trust a custom CA certificate (e.g., for internal services with self-signed certificates):
42+
43+
1. Create a Secret with your CA certificate:
44+
45+
```bash
46+
kubectl create secret generic my-root-ca \
47+
--from-file=ca.crt=./path/to/ca-certificate.crt
48+
```
49+
50+
2. Reference it in values:
51+
52+
```yaml
53+
customRootCA: my-root-ca
54+
```
55+
56+
The certificate will be mounted to `/etc/ssl/certs/custom-root-ca.crt` and the `SSL_CERT_FILE` environment variable will be set automatically.
57+
3558
### Service
3659

3760
| Parameter | Description | Default Value |

deploy/helm/templates/statefulset.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,24 @@ spec:
3939
- name: {{ .Chart.Name }}
4040
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4141
imagePullPolicy: {{ .Values.image.pullPolicy }}
42+
{{- if .Values.customRootCA }}
43+
env:
44+
- name: SSL_CERT_FILE
45+
value: /etc/ssl/certs/custom-root-ca.crt
46+
{{- end }}
4247
ports:
4348
- name: http
4449
containerPort: {{ .Values.service.targetPort }}
4550
protocol: TCP
4651
volumeMounts:
4752
- name: postgresus-storage
4853
mountPath: {{ .Values.persistence.mountPath }}
54+
{{- if .Values.customRootCA }}
55+
- name: custom-root-ca
56+
mountPath: /etc/ssl/certs/custom-root-ca.crt
57+
subPath: ca.crt
58+
readOnly: true
59+
{{- end }}
4960
resources:
5061
{{- toYaml .Values.resources | nindent 12 }}
5162
{{- if .Values.livenessProbe.enabled }}
@@ -66,6 +77,12 @@ spec:
6677
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
6778
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
6879
{{- end }}
80+
{{- if .Values.customRootCA }}
81+
volumes:
82+
- name: custom-root-ca
83+
secret:
84+
secretName: {{ .Values.customRootCA }}
85+
{{- end }}
6986
{{- if .Values.persistence.enabled }}
7087
volumeClaimTemplates:
7188
- metadata:

deploy/helm/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ image:
99
# StatefulSet configuration
1010
replicaCount: 1
1111

12+
# RootCA setup, need name of secret in same namespace
13+
customRootCA: ""
14+
1215
# Service configuration
1316
service:
1417
type: ClusterIP

0 commit comments

Comments
 (0)