Enabling Apparmor for drydock init and test containers

Change-Id: I7aca8fd1dabc19603a33466175263c4a7f3fa36d
This commit is contained in:
DODDA, PRATEEK 2020-05-20 11:04:20 -05:00 committed by DODDA, PRATEEK REDDY (pd2839)
parent 1755930331
commit d862a5171f
6 changed files with 28 additions and 5 deletions

View File

@ -37,7 +37,7 @@ spec:
{{ $labels | indent 8 }}
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
{{ dict "envAll" $envAll "podName" "drydock-api" "containerNames" (list "drydock-api") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
{{ dict "envAll" $envAll "podName" "drydock-api" "containerNames" (list "init" "drydock-api") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
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:

View File

@ -29,6 +29,11 @@ spec:
template:
metadata:
labels:
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
{{ dict "envAll" $envAll "podName" "drydock-db-init" "containerNames" (list "init" "drydock-db-init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
{{ tuple $envAll "drydock" "db-init" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}

View File

@ -29,6 +29,11 @@ spec:
template:
metadata:
labels:
annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
{{ dict "envAll" $envAll "podName" "drydock-db-sync" "containerNames" (list "init" "drydock-db-sync") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
{{ tuple $envAll "drydock" "db-sync" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
spec:
serviceAccountName: {{ $serviceAccountName }}

View File

@ -21,10 +21,11 @@ Test that the API is up and the health endpoint returns a 2XX code */}}
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-api-test"
name: drydock-api-test
annotations:
"helm.sh/hook": "test-success"
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
{{ dict "envAll" $envAll "podName" "drydock-api-test" "containerNames" (list "drydock-api-test") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 4 }}
labels:
{{ tuple $envAll "drydock" "api-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
@ -32,7 +33,7 @@ spec:
nodeSelector:
{{ .Values.labels.test.node_selector_key }}: {{ .Values.labels.test.node_selector_value }}
containers:
- name: "{{ .Release.Name }}-api-test"
- name: drydock-api-test
env:
- name: 'DRYDOCK_URL'
value: {{ tuple "physicalprovisioner" "internal" "api" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | quote }}

View File

@ -22,10 +22,11 @@ requests */}}
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-auth-test"
name: drydock-auth-test
annotations:
helm.sh/hook: "test-success"
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
{{ dict "envAll" $envAll "podName" "drydock-auth-test" "containerNames" (list "drydock-auth-test") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 4 }}
labels:
{{ tuple $envAll "drydock" "auth-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
spec:
@ -33,7 +34,7 @@ spec:
nodeSelector:
{{ .Values.labels.test.node_selector_key }}: {{ .Values.labels.test.node_selector_value }}
containers:
- name: "{{ .Release.Name }}-auth-test"
- name: drydock-auth-test
env:
- name: 'DRYDOCK_URL'
value: {{ tuple "physicalprovisioner" "internal" "api" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | quote }}

View File

@ -61,7 +61,18 @@ pod:
mandatory_access_control:
type: apparmor
drydock-api:
init: runtime/default
drydock-api: runtime/default
drydock-db-init:
init: runtime/default
drydock-db-init: runtime/default
drydock-db-sync:
init: runtime/default
drydock-db-sync: runtime/default
drydock-api-test:
drydock-api-test: runtime/default
drydock-auth-test:
drydock-auth-test: runtime/default
security_context:
drydock:
pod: