[WIP] Implement Security Context for Armada

Implement container and pod level security context for the following
Armada resources:

- Armada server deployment

Change-Id: Ic4caba4a75ba00c92aff2e8fc16e480463632e04
This commit is contained in:
pd2839 2019-02-25 16:18:55 -06:00 committed by PRATEEK REDDY DODDA
parent af8a9ffd08
commit 6fbafb975f
2 changed files with 9 additions and 5 deletions

View File

@ -82,6 +82,7 @@ spec:
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
spec:
{{ dict "envAll" $envAll "application" "armada" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
serviceAccountName: {{ $serviceAccountName }}
affinity:
{{ tuple $envAll "armada" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
@ -94,6 +95,7 @@ spec:
- name: armada-api
{{ tuple $envAll "api" | 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" "armada" "container" "armada_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
{{- if .Values.pod.env.armada_api }}
env:
{{- range .Values.pod.env.armada_api }}
@ -101,8 +103,6 @@ spec:
value: {{ .value | quote }}
{{- end }}
{{- end }}
securityContext:
runAsUser: {{ .Values.pod.user.armada.uid }}
ports:
- name: armada-api
containerPort: {{ tuple "armada" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}

View File

@ -211,6 +211,13 @@ conf:
history_max: 0
pod:
security_context:
armada:
pod:
runAsUser: 65534
container:
armada_api:
allowPrivilegeEscalation: false
env:
# NOTE(@drewwalters96): These configuration values change the Armada API's
# uWSGI configuration.
@ -240,9 +247,6 @@ pod:
mounts:
armada_api:
init_container: null
user:
armada:
uid: 1000
affinity:
anti:
type: