How to mount a volume to a Kubernetes Pod running a docker container from the Airflow host that triggers it using the KubernetesPodOperator

I have a DAG in airflow that uses the KubernetesPodOperator and I am trying to get some files that are generated by the container running in the pod back to the airflow host. For development my host is a Docker container running an airflow image with a docker-desktop K8s cluster and for production I am using an AWS EC2 box with EKS.

volume_mount = VolumeMount('dbt-home',
                           mount_path=<CONTAINER_DIR>,
                           sub_path=None,
                           read_only=False)

volume_config= {
    'hostPath':
      {'path': <HOST_DIR>, 'type': 'DirectoryOrCreate'}
    }

volume = Volume(name="dbt-home", configs=volume_config)


dbt_run = KubernetesPodOperator(
                          namespace='default',
                          image=MY_IMAGE>,
                          cmds=["bash", "-cx"],
                          arguments=[command],
                          env_vars=MY_ENVIRONMENT,
                          volumes=[volume],
                          volume_mounts=[volume_mount],
                          name="test-run",
                          task_id="test-run-task",
                          config_file=config_file,
                          get_logs=True,
                          reattach_on_restart=True,
                          dag=dag
                          )

I tried using the hostPath type for the volume but i think that it refers to the host of the pod. I looked in the kubernetes documentation around volumes where I found the EmptyDir one which didnt work out either.

Source: Docker Questions