Merge "Implement missing security context for placement container"

This commit is contained in:
Zuul 2020-09-17 19:38:42 +00:00 committed by Gerrit Code Review
commit c8d85cc5e2
3 changed files with 14 additions and 2 deletions

View File

@ -48,6 +48,7 @@ spec:
{{ dict "envAll" $envAll "podName" "placement-api" "containerNames" (list "placement-api" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "placement" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
affinity:
{{ tuple $envAll "placement" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
nodeSelector:
@ -59,6 +60,7 @@ spec:
- name: placement-api
{{ tuple $envAll "placement" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "placement" "container" "placement_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/placement-api.sh
- start

View File

@ -33,6 +33,7 @@ spec:
{{ dict "envAll" $envAll "podName" "placement-db-migrate" "containerNames" (list "placement-mysql-migration" "init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}
{{ dict "envAll" $envAll "application" "placement" | 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 }}
@ -42,6 +43,7 @@ spec:
- name: placement-mysql-migration
{{ tuple $envAll $service | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.ks_service | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "placement" "container" "placement_mysql_migration" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
command:
- /tmp/db-migrate.sh
env:

View File

@ -316,9 +316,17 @@ endpoints:
public: 80
pod:
user:
security_context:
placement:
uid: 42424
pod:
runAsUser: 42424
container:
placement_api:
readOnlyRootFilesystem: false
runAsUser: 0
placement_mysql_migration:
readOnlyRootFilesystem: false
runAsUser: 0
affinity:
anti:
type: