I am trying to mount dags folder to be able to run a python script inside of the KubernetesPodOperator on Aiflow, but can't figure out how to do it. In production I would like to do it in Google Composer. Here is my task:
kubernetes_min_pod = KubernetesPodOperator(
task_id='pod-ex-minimum',
cmds=["bash", "-c"],
arguments=["cd /usr/local/tmp"],
namespace='default',
image='toru2220/scrapy-chrome:latest',
is_delete_operator_pod=True,
get_logs=True,
in_cluster=False,
volumes=[
Volume("my-volume", {"persistentVolumeClaim": {"claimName": "my-volume"}})
],
volume_mounts=[
VolumeMount("my-volume", "/usr/local/tmp", sub_path=None, read_only=False)
],
)
I am trying to understand what is the easiest way to mount the current folder where dag is?