Skip to content

Commit 75b4182

Browse files
committed
chart: add configurable Secret name and keys for mongodb tls client
1 parent 299d221 commit 75b4182

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

chart/mongodb-probe/templates/configmap.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ data:
88
spring.profiles.active=k8s
99
1010
spring.ssl.bundle.pem.mongodb-ssl-bundle.reload-on-update=true
11-
spring.ssl.bundle.pem.mongodb-ssl-bundle.keystore.certificate=file:/workspace/config/tls.crt
12-
spring.ssl.bundle.pem.mongodb-ssl-bundle.keystore.private-key=file:/workspace/config/tls.key
11+
spring.ssl.bundle.pem.mongodb-ssl-bundle.truststore.certificate=file:/workspace/config/{{ .Values.mongodb.tlsSecretCaKey }}
12+
spring.ssl.bundle.pem.mongodb-ssl-bundle.keystore.private-key=file:/workspace/config/{{ .Values.mongodb.tlsCertKey }}
1313
1414
spring.data.mongodb.uri={{ .Values.mongodb.uri }}
1515
spring.data.mongodb.ssl.enabled=true
@@ -21,4 +21,3 @@ data:
2121
otel.exporter.otlp.endpoint={{ .Values.otlp.tracing.endpoint }}
2222
otel.service.name={{ .Values.otlp.serviceName }}
2323
spring.application.name={{ .Values.otlp.serviceName }}
24-

chart/mongodb-probe/values.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,20 @@ volumes:
8383
- name: config
8484
configMap:
8585
name: mongodb-probe-config
86-
# - name: foo
87-
# secret:
88-
# secretName: mysecret
89-
# optional: false
86+
87+
- name: tls
88+
secret:
89+
secretName: {{ .Values.mongodb.tlsSecretname }}
90+
optional: false
9091

9192
# Additional volumeMounts on the output Deployment definition.
9293
volumeMounts:
9394
- name: config
9495
mountPath: /workspace/config
96+
97+
- name: tls
98+
mountPath: /workspace/config/tls
99+
readOnly: true
95100

96101
# Additional env vars
97102
envs: []
@@ -105,9 +110,11 @@ tolerations: []
105110

106111
affinity: {}
107112

108-
109113
#probe specific default values
110114
mongodb:
115+
tlsSecretname: mysecret
116+
tlsSecretCaKey: ca.crt
117+
tlsCertKey: tls.crt
111118
uri: mongodb://admin:password@localhost:27017/mydb
112119

113120
otlp:

0 commit comments

Comments
 (0)