Skip to content
Snippets Groups Projects
Commit 5689fb93 authored by OZGCloud's avatar OZGCloud
Browse files

optional trust store

parent 5889b888
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,17 @@ spec: ...@@ -110,6 +110,17 @@ spec:
{{- with (.Values.env).customList }} {{- with (.Values.env).customList }}
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}
{{- end }} {{- end }}
{{- if .Values.optionalTrustStoreSecretName }}
- name: TRUST_STORE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.optionalTrustStoreSecretName }}
key: password
optional: false
args:
- '-Djavax.net.ssl.trustStore=/optional-trust-store/truststore.jks'
- '-Djavax.net.ssl.trustStorePassword=$(TRUST_STORE_PASSWORD)'
{{- end }}
image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ coalesce (.Values.image).tag "latest" }}" image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ coalesce (.Values.image).tag "latest" }}"
imagePullPolicy: Always imagePullPolicy: Always
name: user-manager name: user-manager
...@@ -167,10 +178,21 @@ spec: ...@@ -167,10 +178,21 @@ spec:
mountPath: "/user-manager-tls-certificate/tls.key" mountPath: "/user-manager-tls-certificate/tls.key"
subPath: tls.key subPath: tls.key
readOnly: true readOnly: true
{{- if .Values.optionalTrustStoreSecretName }}
- name: optional-trust-store
mountPath: "/optional-trust-store/truststore.jks"
subPath: truststore.jks
readOnly: true
{{- end }}
volumes: volumes:
- name: user-manager-tls-certificate - name: user-manager-tls-certificate
secret: secret:
secretName: user-manager-tls-cert secretName: user-manager-tls-cert
{{- if .Values.optionalTrustStoreSecretName }}
- name: optional-trust-store
secret:
secretName: {{ .Values.optionalTrustStoreSecretName }}
{{- end }}
dnsConfig: {} dnsConfig: {}
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
imagePullSecrets: imagePullSecrets:
......
#
# Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den
# Ministerpräsidenten des Landes Schleswig-Holstein
# Staatskanzlei
# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
#
# Lizenziert unter der EUPL, Version 1.2 oder - sobald
# diese von der Europäischen Kommission genehmigt wurden -
# Folgeversionen der EUPL ("Lizenz");
# Sie dürfen dieses Werk ausschließlich gemäß
# dieser Lizenz nutzen.
# Eine Kopie der Lizenz finden Sie hier:
#
# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
#
# Sofern nicht durch anwendbare Rechtsvorschriften
# gefordert oder in schriftlicher Form vereinbart, wird
# die unter der Lizenz verbreitete Software "so wie sie
# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
# ausdrücklich oder stillschweigend - verbreitet.
# Die sprachspezifischen Genehmigungen und Beschränkungen
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
suite: test environments
templates:
- templates/deployment.yaml
tests:
- it: check without truststore
asserts:
- isEmpty:
path: spec.template.spec.containers[0].args
- notContains:
path: spec.template.spec.containers[0].env
content:
name: TRUST_STORE_PASSWORD
- notContains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: optional-trust-store
mountPath: "/optional-trust-store/truststore.jks"
subPath: truststore.jks
readOnly: true
- notContains:
path: spec.template.spec.volumes
content:
name: optional-trust-store
- it: check with truststore
set:
optionalTrustStoreSecretName: optional-trust-store-secret
asserts:
- equal:
path: spec.template.spec.containers[0].args
value:
- '-Djavax.net.ssl.trustStore=/optional-trust-store/truststore.jks'
- '-Djavax.net.ssl.trustStorePassword=$(TRUST_STORE_PASSWORD)'
- contains:
path: spec.template.spec.containers[0].env
content:
name: TRUST_STORE_PASSWORD
valueFrom:
secretKeyRef:
name: optional-trust-store-secret
key: password
optional: false
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: optional-trust-store
mountPath: "/optional-trust-store/truststore.jks"
subPath: truststore.jks
readOnly: true
- contains:
path: spec.template.spec.volumes
content:
name: optional-trust-store
secret:
secretName: optional-trust-store-secret
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment