Implement helm-toolkit snippet to promenade test pods/containers

This updates the promenade chart to include the pod
security context on the pod template.

This also adds the container security context to set
readOnlyRootFilesystem flag to true

Change-Id: I688017f329b267e75178053b8e18d56090900f11
This commit is contained in:
KHIYANI, RAHUL (rk0850) 2020-06-30 00:19:38 -05:00
parent c6c7a3accd
commit 62c4040a41
2 changed files with 10 additions and 1 deletions

View File

@ -30,6 +30,7 @@ metadata:
labels:
{{ tuple $envAll "promenade" "api-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
{{ dict "envAll" $envAll "application" "api_test" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 2 }}
restartPolicy: Never
nodeSelector:
{{ .Values.labels.test.node_selector_key }}: {{ .Values.labels.test.node_selector_value }}
@ -43,6 +44,7 @@ spec:
image: {{ .Values.images.tags.promenade }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple . .Values.pod.resources.test | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
{{ dict "envAll" $envAll "application" "api_test" "container" "promenade_api_test" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 6 }}
command: ["/bin/bash", "-c", "curl -v -X GET --fail ${PROM_URL}/api/v1.0/health; exit $?"]
...
{{- end }}

View File

@ -180,8 +180,15 @@ pod:
runAsUser: 65534
container:
promenade_api:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
api_test:
pod:
runAsUser: 65534
container:
promenade_api_test:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
mandatory_access_control:
type: apparmor
promenade-api: