Implement helm-toolkit snippet to airflow pods/containers
This updates the airflow chart to include the pod security context on the pod template. This also adds the container security context to set readOnlyRootFilesystem flag Change-Id: I84cd4581d6ae915e9caf5c50d407dfcc34b962b3
This commit is contained in:
parent
66d410779c
commit
db37122336
@ -36,6 +36,7 @@ spec:
|
|||||||
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||||
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||||
spec:
|
spec:
|
||||||
|
{{ dict "envAll" $envAll "application" "db_init" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
||||||
serviceAccountName: {{ $serviceAccountName }}
|
serviceAccountName: {{ $serviceAccountName }}
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
@ -47,6 +48,7 @@ spec:
|
|||||||
image: {{ .Values.images.tags.airflow_db_init | quote }}
|
image: {{ .Values.images.tags.airflow_db_init | quote }}
|
||||||
imagePullPolicy: {{ .Values.images.pull_policy | quote }}
|
imagePullPolicy: {{ .Values.images.pull_policy | quote }}
|
||||||
{{ tuple $envAll $envAll.Values.pod.resources.jobs.airflow_db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
{{ tuple $envAll $envAll.Values.pod.resources.jobs.airflow_db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||||
|
{{ dict "envAll" $envAll "application" "db_init" "container" "airflow_db_init" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
|
||||||
env:
|
env:
|
||||||
- name: DB_HOST
|
- name: DB_HOST
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
@ -36,6 +36,7 @@ spec:
|
|||||||
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
configmap-bin-hash: {{ tuple "configmap-airflow-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||||
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
configmap-etc-hash: {{ tuple "configmap-airflow-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
||||||
spec:
|
spec:
|
||||||
|
{{ dict "envAll" $envAll "application" "db_sync" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
||||||
serviceAccountName: {{ $serviceAccountName }}
|
serviceAccountName: {{ $serviceAccountName }}
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
@ -47,6 +48,7 @@ spec:
|
|||||||
image: {{ .Values.images.tags.airflow_db_sync }}
|
image: {{ .Values.images.tags.airflow_db_sync }}
|
||||||
imagePullPolicy: {{ .Values.images.pull_policy }}
|
imagePullPolicy: {{ .Values.images.pull_policy }}
|
||||||
{{ tuple $envAll $envAll.Values.pod.resources.jobs.airflow_db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
{{ tuple $envAll $envAll.Values.pod.resources.jobs.airflow_db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||||
|
{{ dict "envAll" $envAll "application" "db_sync" "container" "airflow_db_sync" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
|
||||||
command:
|
command:
|
||||||
- /tmp/airflow-db-sync.sh
|
- /tmp/airflow-db-sync.sh
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
@ -797,6 +797,9 @@ pod:
|
|||||||
shipyard_db_init:
|
shipyard_db_init:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
airflow_db_init:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
db_sync:
|
db_sync:
|
||||||
pod:
|
pod:
|
||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
@ -804,6 +807,9 @@ pod:
|
|||||||
shipyard_db_sync:
|
shipyard_db_sync:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
|
airflow_db_sync:
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
api_test:
|
api_test:
|
||||||
pod:
|
pod:
|
||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user