Skip to content

Commit

Permalink
Fix DAGs mount path in Kubernetes worker pod when gitSync is enabled …
Browse files Browse the repository at this point in the history
…(#13826)

* Update pod-template-file.kubernetes-helm-yaml

* Fix ssh-key access issue

This change allows dags.gitSync.containerName to read ssh-key from file system.
Similar to this https://github.com/varunvora/airflow/blob/ce0e6280d2ea39838e9f0617625cd07a757c3461/chart/templates/scheduler/scheduler-deployment.yaml#L92
It solves apache/airflow#13680 issue for private repositories.

Co-authored-by: Denis Krivenko <[email protected]>
GitOrigin-RevId: 5f74219e6d400c4eae9134f6015c72430d6d549f
  • Loading branch information
2 people authored and Cloud Composer Team committed Jan 27, 2023
1 parent abcccc9 commit 0f7f3d6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chart/files/pod-template-file.kubernetes-helm-yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,16 @@ spec:
name: git-sync-ssh-key
subPath: ssh
{{- end }}
{{- if or .Values.dags.gitSync.enabled .Values.dags.persistence.enabled }}
{{- if .Values.dags.persistence.enabled }}
- mountPath: {{ include "airflow_dags_mount_path" . }}
name: dags
readOnly: true
{{- end }}
{{- if .Values.dags.gitSync.enabled }}
- mountPath: {{ include "airflow_dags" . }}
name: dags
readOnly: true
subPath: {{.Values.dags.gitSync.dest }}/{{ .Values.dags.gitSync.subPath }}
{{- end }}
{{- end }}
hostNetwork: false
{{- if or .Values.registry.secretName .Values.registry.connection }}
Expand All @@ -77,6 +80,7 @@ spec:
restartPolicy: Never
securityContext:
runAsUser: {{ .Values.uid }}
fsGroup: {{ .Values.gid }}
nodeSelector: {{ toYaml .Values.nodeSelector | nindent 4 }}
affinity: {{ toYaml .Values.affinity | nindent 4 }}
tolerations: {{ toYaml .Values.tolerations | nindent 4 }}
Expand Down

0 comments on commit 0f7f3d6

Please sign in to comment.