【发布时间】:2020-03-22 02:24:48
【问题描述】:
我正在将气流与 kubernetes 执行器一起使用。
当我使用 executor_config 挂载 PersistentVolumeClaim 时,它可以工作。
但是,我只想安装一个动态的 subPath,如下所示:
executor_config={
"KubernetesExecutor":
{"volumes": [
{
"name": "workdir-volume",
"persistentVolumeClaim": {"claimName": "my-volume-claim"},
},
],
"volume_mounts": [
{
"mountPath": "/app/workdir/",
"name": "workdir-volume",
"subPath": "{{ run_id }}_{{ ds }}"
},
]}
},
它不起作用有两个原因:
executor_config 不在 template_fields 中。因此,我创建了一个包含 executor_config 的新运算符。
我的理解是渲染只在 pod 启动后完成,因为当我从仪表板查看渲染的任务时,它很好,但是挂载的目录没有渲染
有人知道如何做到这一点吗?
【问题讨论】:
标签: python kubernetes airflow