Skip to content

Commit cd5a6a0

Browse files
committed
Adds optional keystore to helm chart.
This enables the use of a keystore provisioned externally or by cert-manager. Uses projected volumes
1 parent 5a15636 commit cd5a6a0

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

chart/templates/statefulset.yaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ spec:
6868
mountPath: {{ .Values.persistence.mountPath }}
6969
subPath: {{ .Values.persistence.subPath }}
7070
{{- end }}
71-
- name: config
72-
mountPath: "/usr/local/etc/polynsi"
71+
- name: combined-config
72+
mountPath: /usr/local/etc/polynsi/
7373
readOnly: true
7474
{{- with .Values.nodeSelector }}
7575
nodeSelector:
@@ -84,9 +84,25 @@ spec:
8484
{{- toYaml . | nindent 8 }}
8585
{{- end }}
8686
volumes:
87-
- name: config
88-
configMap:
89-
name: {{ printf "%s-config" (include "PolyNSI.fullname" .) }}
87+
- name: combined-config
88+
projected:
89+
sources:
90+
- configMap:
91+
name: {{ printf "%s-config" (include "PolyNSI.fullname" .) }}
92+
{{- if .Values.keystore.enabled }}
93+
- secret:
94+
name: {{ .Values.keystore.secretName }}
95+
items:
96+
- key: {{ .Values.keystore.key }}
97+
path: polynsi-keystore.jks
98+
{{- end }}
99+
{{- if .Values.truststore.enabled }}
100+
- secret:
101+
name: {{ .Values.truststore.secretName }}
102+
items:
103+
- key: {{ .Values.truststore.key }}
104+
path: polynsi-truststore.jks
105+
{{- end }}
90106
{{- if .Values.persistence.enabled }}
91107
volumeClaimTemplates:
92108
- metadata:
@@ -105,4 +121,4 @@ spec:
105121
resources:
106122
requests:
107123
storage: {{ .Values.persistence.size | quote }}
108-
{{- end }}
124+
{{- end }}

chart/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ persistence:
8787
- ReadWriteOnce
8888
size: 1Gi
8989

90+
keystore:
91+
enabled: false
92+
secretName: polynsi-keystore
93+
key: keystore.jks
94+
95+
truststore:
96+
enabled: false
97+
secretName: polynsi-truststore
98+
key: truststore.jks
99+
90100
config:
91101
# either read config files from folder or use inline data, filesGlob takes precedence over inline.
92102
#filesGlob: "config/*"

0 commit comments

Comments
 (0)