Merge "Add missing security context to Horizon test pods/containers"

This commit is contained in:
Zuul 2020-07-16 18:53:46 +00:00 committed by Gerrit Code Review
commit 1fd839139d
3 changed files with 19 additions and 0 deletions

View File

@ -36,6 +36,7 @@ spec:
{{ dict "envAll" $envAll "podName" "horizon-db-sync" "containerNames" (list "horizon-db-sync" "init" ) | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "db_sync" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
restartPolicy: OnFailure
nodeSelector:
{{ .Values.labels.job.node_selector_key }}: {{ .Values.labels.job.node_selector_value }}
@ -45,6 +46,7 @@ spec:
- name: horizon-db-sync
{{ tuple $envAll "horizon_db_sync" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "db_sync" "container" "horizon_db_sync" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/db-sync.sh
volumeMounts:

View File

@ -32,6 +32,7 @@ metadata:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
{{ dict "envAll" $envAll "podName" "horizon-test" "containerNames" (list "init" "horizon-test") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 4 }}
spec:
{{ dict "envAll" $envAll "application" "test" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 2 }}
restartPolicy: Never
serviceAccountName: {{ $serviceAccountName }}
nodeSelector:
@ -42,6 +43,7 @@ spec:
- name: horizon-test
{{ tuple $envAll "test" | include "helm-toolkit.snippets.image" | indent 6 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.tests | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
{{ dict "envAll" $envAll "application" "test" "container" "horizon_test" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 6 }}
command:
- /tmp/selenium-test.py
env:

View File

@ -2044,6 +2044,21 @@ pod:
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
runAsUser: 0
db_sync:
pod:
runAsUser: 42424
container:
horizon_db_sync:
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
runAsUser: 0
test:
pod:
runAsUser: 42424
container:
horizon_test:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
affinity:
anti:
type: