Skip to content

Conversation

@EnricoMi
Copy link
Contributor

@EnricoMi EnricoMi commented Sep 20, 2024

What changes were proposed in this pull request?

Add the following config options:

  • spark.kubernetes.executor.volumes.[VolumeType].[VolumeName].mount.subPathExpr
  • spark.kubernetes.executor.volumes.hostPath.[VolumeName].options.type

Why are the changes needed?

K8s Spec

These are natural extensions of the existing options

  • spark.kubernetes.executor.volumes.[VolumeType].[VolumeName].mount.subPath
  • spark.kubernetes.executor.volumes.hostPath.[VolumeName].options.path

Does this PR introduce any user-facing change?

Above config options.

How was this patch tested?

Unit tests

Was this patch authored or co-authored using generative AI tooling?

No

@dongjoon-hyun dongjoon-hyun changed the title [SPARK-49731][K8S] Add hostPath volume type and mount subPathExpr to kubernetes volume options [SPARK-49731][K8S] Support K8s volume mount.subPathExpr and hostPath volume type Sep 25, 2024
Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @EnricoMi . The PR looks good.

Could you add a test coverage for this? What happens when we add both? I believe it would be prevented by error before submitting the jobs to the K8s cluster, @EnricoMi .

The subPath and subPathExpr properties are mutually exclusive.

@dongjoon-hyun
Copy link
Member

Also, I revised the PR description by adding K8s reference links because this is a community patch.

@EnricoMi
Copy link
Contributor Author

I have added a check for subPath and subPathExpr not being set together to provide a useful error message early (noting the exact Spark config key cases the failure).

@EnricoMi
Copy link
Contributor Author

Could you add a test coverage for this?

I have added more tests.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you so much, @EnricoMi .
Merged to master for Apache Spark 4.0.0.

turboFei pushed a commit to turboFei/spark that referenced this pull request Nov 6, 2025
… and `hostPath` volume `type`

Add the following config options:
- `spark.kubernetes.executor.volumes.[VolumeType].[VolumeName].mount.subPathExpr`
- `spark.kubernetes.executor.volumes.hostPath.[VolumeName].options.type`

K8s Spec
- https://kubernetes.io/docs/concepts/storage/volumes/#hostpath-volume-types
- https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath-expanded-environment

These are natural extensions of the existing options
- `spark.kubernetes.executor.volumes.[VolumeType].[VolumeName].mount.subPath`
- `spark.kubernetes.executor.volumes.hostPath.[VolumeName].options.path`

Above config options.

Unit tests

No

Closes apache#48181 from EnricoMi/k8s-volume-options.

Authored-by: Enrico Minack <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 1129c456dbe0b0dcb157b6f6964f677ac2ed0117)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants