Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions chart/templates/scheduler/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ spec:
- name: dags
mountPath: {{ template "airflow_dags_mount_path" . }}
{{- include "git_sync_container" . | indent 8 }}
{{- end }}
{{- if .Values.scheduler.extraVolumeMounts }}
{{ toYaml .Values.scheduler.extraVolumeMounts | indent 12 }}
{{- end }}
# Always start the garbage collector sidecar.
- name: scheduler-gc
Expand Down Expand Up @@ -199,6 +202,9 @@ spec:
{{- if and .Values.dags.gitSync.enabled .Values.dags.gitSync.sshKeySecret }}
{{- include "git_sync_ssh_key_volume" . | indent 8 }}
{{- end }}
{{- if .Values.scheduler.extraVolumes }}
{{ toYaml .Values.scheduler.extraVolumes | indent 8 }}
{{- end }}
{{- if not $stateful }}
- name: logs
emptyDir: {}
Expand Down
6 changes: 6 additions & 0 deletions chart/templates/workers/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ spec:
- name: worker-logs
containerPort: {{ .Values.ports.workerLogs }}
volumeMounts:
{{- if .Values.workers.extraVolumeMounts }}
{{ toYaml .Values.workers.extraVolumeMounts | indent 12 }}
{{- end }}
- name: logs
mountPath: {{ template "airflow_logs" . }}
- name: config
Expand Down Expand Up @@ -200,6 +203,9 @@ spec:
{{- include "standard_airflow_environment" . | indent 10 }}
{{- end }}
volumes:
{{- if .Values.workers.extraVolumes }}
{{ toYaml .Values.workers.extraVolumes | indent 8 }}
{{- end }}
- name: kerberos-keytab
secret:
secretName: {{ include "kerberos_keytab_secret" . | quote }}
Expand Down
38 changes: 38 additions & 0 deletions chart/tests/scheduler_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

---
templates:
- scheduler/scheduler-deployment.yaml
tests:
- it: should add extraVolume and extraVolumeMount
set:
executor: CeleryExecutor
scheduler:
extraVolumes:
- name: test-volume
emptyDir: {}
extraVolumeMounts:
- name: test-volume
mountPath: /opt/test
asserts:
- equal:
path: spec.template.spec.volumes[1].name
value: test-volume
- equal:
path: spec.template.spec.containers[0].volumeMounts[3].name
value: test-volume
38 changes: 38 additions & 0 deletions chart/tests/worker_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

---
templates:
- workers/worker-deployment.yaml
tests:
- it: should add extraVolume and extraVolumeMount
set:
executor: CeleryExecutor
workers:
extraVolumes:
- name: test-volume
emptyDir: {}
extraVolumeMounts:
- name: test-volume
mountPath: /opt/test
asserts:
- equal:
path: spec.template.spec.volumes[0].name
value: test-volume
- equal:
path: spec.template.spec.containers[0].volumeMounts[0].name
value: test-volume
20 changes: 18 additions & 2 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,15 @@
"description": "Annotations to add to the worker kubernetes service account.",
"type": "object"
}
}
},
"extraVolumes": {
"description": "Mount additional volumes into workers.",
"type": "array"
},
"extraVolumeMounts": {
"description": "Mount additional volumes into workers.",
"type": "array"
}
},
"scheduler": {
"description": "Airflow scheduler settings.",
Expand Down Expand Up @@ -516,7 +524,15 @@
"description": "Annotations to add to the scheduler kubernetes service account.",
"type": "object"
}
}
},
"extraVolumes": {
"description": "Mount additional volumes into scheduler.",
"type": "array"
},
"extraVolumeMounts": {
"description": "Mount additional volumes into scheduler.",
"type": "array"
}
},
"webserver": {
"description": "Airflow webserver settings.",
Expand Down
7 changes: 7 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ workers:
safeToEvict: true
# Annotations to add to worker kubernetes service account.
serviceAccountAnnotations: {}
# Mount additional volumes into worker.
extraVolumes: []
extraVolumeMounts: []

# Airflow scheduler settings
scheduler:
Expand Down Expand Up @@ -316,6 +319,10 @@ scheduler:
# Annotations to add to scheduler kubernetes service account.
serviceAccountAnnotations: {}

# Mount additional volumes into scheduler.
extraVolumes: []
extraVolumeMounts: []

# Airflow webserver settings
webserver:
livenessProbe:
Expand Down