diff --git a/charts/deckhand/templates/job-db-init.yaml b/charts/deckhand/templates/job-db-init.yaml index 9eea456a..aa415edb 100644 --- a/charts/deckhand/templates/job-db-init.yaml +++ b/charts/deckhand/templates/job-db-init.yaml @@ -36,6 +36,7 @@ spec: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} {{ dict "envAll" $envAll "podName" "deckhand-db-init" "containerNames" (list "init" "deckhand-db-init") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: +{{ dict "envAll" $envAll "application" "db_init" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} restartPolicy: OnFailure nodeSelector: @@ -47,6 +48,7 @@ spec: image: {{ .Values.images.tags.db_init | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} +{{ dict "envAll" $envAll "application" "db_init" "container" "deckhand_db_init" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} env: - name: USER_DB_NAME valueFrom: diff --git a/charts/deckhand/templates/job-db-sync.yaml b/charts/deckhand/templates/job-db-sync.yaml index d1a39352..d8e40f82 100644 --- a/charts/deckhand/templates/job-db-sync.yaml +++ b/charts/deckhand/templates/job-db-sync.yaml @@ -36,6 +36,7 @@ spec: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} {{ dict "envAll" $envAll "podName" "deckhand-db-sync" "containerNames" (list "init" "deckhand-db-sync") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: +{{ dict "envAll" $envAll "application" "db_sync" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} restartPolicy: OnFailure nodeSelector: @@ -47,6 +48,7 @@ spec: image: {{ .Values.images.tags.db_sync | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} {{ tuple $envAll $envAll.Values.pod.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} +{{ dict "envAll" $envAll "application" "db_sync" "container" "deckhand_db_sync" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} env: - name: DECKHAND_DB_URL valueFrom: diff --git a/charts/deckhand/templates/tests/test-deckhand-api.yaml b/charts/deckhand/templates/tests/test-deckhand-api.yaml index 95dab0e7..20db61ae 100644 --- a/charts/deckhand/templates/tests/test-deckhand-api.yaml +++ b/charts/deckhand/templates/tests/test-deckhand-api.yaml @@ -30,6 +30,7 @@ metadata: labels: {{ tuple $envAll "deckhand" "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 }} @@ -41,6 +42,7 @@ spec: image: {{ .Values.images.tags.deckhand }} imagePullPolicy: {{ .Values.images.pull_policy }} {{ tuple . .Values.pod.resources.test.deckhand | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} +{{ dict "envAll" $envAll "application" "api_test" "container" "deckhand_api_test" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 6 }} command: ["/bin/bash", "-c", "curl -v -X GET --fail ${DECKHAND_URL}/api/v1.0/health; exit $?"] ... {{- end }} diff --git a/charts/deckhand/values.yaml b/charts/deckhand/values.yaml index 7850e289..244e5c56 100644 --- a/charts/deckhand/values.yaml +++ b/charts/deckhand/values.yaml @@ -346,6 +346,27 @@ pod: deckhand_api: readOnlyRootFilesystem: true allowPrivilegeEscalation: false + db_init: + pod: + runAsUser: 65534 + container: + deckhand_db_init: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + db_sync: + pod: + runAsUser: 65534 + container: + deckhand_db_sync: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false + api_test: + pod: + runAsUser: 65534 + container: + deckhand_api_test: + readOnlyRootFilesystem: true + allowPrivilegeEscalation: false mounts: deckhand_db_init: init_container: null