Skip to content
Snippets Groups Projects
Commit e81401fa authored by Jan Zickermann's avatar Jan Zickermann
Browse files

#2 OZG-7121 helm: Configure keystore and truststore in deployment

parent efc8aa07
No related branches found
No related tags found
1 merge request!3Resolve "xta-test-server helm-chart mit Deployment und Keystore-Secrets/Certificate-Resources"
Pipeline #1315 skipped
...@@ -48,9 +48,7 @@ test-helm: ...@@ -48,9 +48,7 @@ test-helm:
- !reference [ .helm, before_script ] - !reference [ .helm, before_script ]
- helm plugin install https://github.com/helm-unittest/helm-unittest.git - helm plugin install https://github.com/helm-unittest/helm-unittest.git
script: script:
- helm template -f src/test/helm-linter-values.yaml src/main/helm - sh run_helm_test.sh
- helm lint -f src/test/helm-linter-values.yaml src/main/helm
- helm unittest -f '../../test/helm/**/*test.yaml' src/main/helm
verify: verify:
stage: test stage: test
......
#!/bin/sh
set -e
helm template -f src/test/helm-linter-values.yaml src/main/helm
helm lint -f src/test/helm-linter-values.yaml src/main/helm
helm unittest -f '../../test/helm/**/*test.yaml' src/main/helm
\ No newline at end of file
...@@ -61,7 +61,10 @@ spec: ...@@ -61,7 +61,10 @@ spec:
- env: - env:
- name: spring_profiles_active - name: spring_profiles_active
value: {{ include "app.envSpringProfiles" . }} value: {{ include "app.envSpringProfiles" . }}
- name: server_ssl_key-store
value: /store/keystore.jks
- name: server_ssl_trust-store
value: /store/truststore.jks
{{- with include "app.getCustomList" . }} {{- with include "app.getCustomList" . }}
{{ . | indent 10 }} {{ . | indent 10 }}
{{- end }} {{- end }}
...@@ -119,25 +122,16 @@ spec: ...@@ -119,25 +122,16 @@ spec:
volumeMounts: volumeMounts:
- name: temp-dir - name: temp-dir
mountPath: "/tmp" mountPath: "/tmp"
- name: bindings - name: xta-test-server-tls-store
mountPath: "/bindings/ca-certificates/type" mountPath: "/store/"
subPath: type
readOnly: true
- name: mongodb-root-ca
mountPath: "/bindings/ca-certificates/mongodb-root-ca.pem"
subPath: ca.crt
readOnly: true readOnly: true
volumes: volumes:
- name: temp-dir - name: temp-dir
emptyDir: {} emptyDir: {}
- name: bindings - name: xta-test-server-tls-store
configMap:
name: xta-test-server-bindings-type
- name: mongodb-root-ca
secret: secret:
secretName: {{ ((.Values.database).tls).secretName | default "ozg-mongodb-tls-cert" }} secretName: {{ .Release.Name }}-tls-secret
optional: true
dnsConfig: {} dnsConfig: {}
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
{{- with .Values.hostAliases }} {{- with .Values.hostAliases }}
......
...@@ -29,6 +29,39 @@ release: ...@@ -29,6 +29,39 @@ release:
namespace: sh-helm-test namespace: sh-helm-test
tests: tests:
- it: should set spring profiles
set:
ozgcloud:
environment: dev
imagePullSecret: image-pull-secret
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: spring_profiles_active
value: oc, dev
- it: should set keystore
set:
ozgcloud:
environment: dev
imagePullSecret: image-pull-secret
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: server_ssl_key-store
value: /store/keystore.jks
- it: should set truststore
set:
ozgcloud:
environment: dev
imagePullSecret: image-pull-secret
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: server_ssl_trust-store
value: /store/truststore.jks
- it: check customList as list - it: check customList as list
set: set:
env.customList: env.customList:
......
...@@ -23,4 +23,22 @@ tests: ...@@ -23,4 +23,22 @@ tests:
path: spec.template.spec.volumes path: spec.template.spec.volumes
content: content:
name: temp-dir name: temp-dir
emptyDir: {} emptyDir: {}
\ No newline at end of file
- it: should have tls store volume
asserts:
- contains:
path: spec.template.spec.volumes
content:
name: xta-test-server-tls-store
secret:
secretName: helm-test-tls-secret
- it: should have truststore volume mount
asserts:
- contains:
path: spec.template.spec.containers[0].volumeMounts
content:
name: xta-test-server-tls-store
mountPath: "/store/"
readOnly: true
\ 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