如何只挂载与run\u id相对应的持久卷声明的目录

2024-05-13 13:36:25 发布

您现在位置:Python中文网/ 问答频道 /正文

我和库伯尼特斯的执行者一起使用气流。你知道吗

当我使用executor\u config挂载PersistentVolumeClaim时,它可以工作。你知道吗

但是,我只想挂载一个动态的子路径,如下所示:

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\u config不在template\u字段中。因此,我创建了一个新操作符,其中包含executor\ u config。

  • 我的理解是,渲染只在pod启动后进行,因为当我从仪表板查看渲染的任务时,它很好,但是挂载的目录没有渲染

有人知道怎么做吗?你知道吗


Tags: name路径configmy动态执行者volume气流