Skip to content

[KYUUBI #7495][KUBERNETES] Avoid overlong pod log directory names#7496

Closed
ruanwenjun wants to merge 1 commit into
apache:masterfrom
ruanwenjun:kyuubi-7495-pod-log-name
Closed

[KYUUBI #7495][KUBERNETES] Avoid overlong pod log directory names#7496
ruanwenjun wants to merge 1 commit into
apache:masterfrom
ruanwenjun:kyuubi-7495-pod-log-name

Conversation

@ruanwenjun

Copy link
Copy Markdown
Member

Why are the changes needed?

Kyuubi currently limits generated Spark driver pod names and executor pod name prefixes only against the Kubernetes pod name limit.

However, kubelet creates pod log directories with the namespace_podName_podUID format. When the generated pod name is close to the Kubernetes pod name limit, the log directory name can exceed the Linux path component limit and kubelet fails to create it.

This patch makes the generated driver pod name and executor pod name prefix reserve the kubelet pod log directory budget. Closes #7495.

How was this patch tested?

  • env PATH="/tmp/kyuubi-black-22.3.0/bin:$PATH" dev/reformat
  • git diff --check HEAD~1..HEAD
  • build/mvn test -pl kyuubi-server -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.util.KubernetesPodNameSuite
  • build/mvn test -pl externals/kyuubi-spark-sql-engine -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.engine.spark.SparkSQLEngineSuite

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

Assisted-by: OpenAI Codex (GPT-5)

@pan3793

pan3793 commented Jun 4, 2026

Copy link
Copy Markdown
Member

this makes sense, and maybe we want a config to always rewrite the name for safety (this can be implemented in a dedicated PR)

@ruanwenjun

ruanwenjun commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

@pan3793 Yes, Kyuubi provides the following configurations, and they work as expected:

kyuubi.kubernetes.spark.forciblyRewriteDriverPodName.enabled
kyuubi.kubernetes.spark.forciblyRewriteExecutorPodNamePrefix.enabled

When enabled, Kyuubi rewrites all pod names and therefore avoids the problem. However, when these options are disabled, there is a bug in the current pod name length validation logic that can result in invalid pod names being accepted.

@pan3793

pan3793 commented Jun 4, 2026

Copy link
Copy Markdown
Member

oh, we already have this feature.

@ruanwenjun

Copy link
Copy Markdown
Member Author

Is this PR ready to merge? cc@pan3793

@pan3793 pan3793 added this to the v1.10.4 milestone Jun 10, 2026
@pan3793 pan3793 closed this in 6f6e0eb Jun 10, 2026
pan3793 pushed a commit that referenced this pull request Jun 10, 2026
### Why are the changes needed?

Kyuubi currently limits generated Spark driver pod names and executor pod name prefixes only against the Kubernetes pod name limit.

However, kubelet creates pod log directories with the `namespace_podName_podUID` format. When the generated pod name is close to the Kubernetes pod name limit, the log directory name can exceed the Linux path component limit and kubelet fails to create it.

This patch makes the generated driver pod name and executor pod name prefix reserve the kubelet pod log directory budget. Closes #7495.

### How was this patch tested?

- `env PATH="/tmp/kyuubi-black-22.3.0/bin:$PATH" dev/reformat`
- `git diff --check HEAD~1..HEAD`
- `build/mvn test -pl kyuubi-server -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.util.KubernetesPodNameSuite`
- `build/mvn test -pl externals/kyuubi-spark-sql-engine -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.engine.spark.SparkSQLEngineSuite`

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

Assisted-by: OpenAI Codex (GPT-5)

Closes #7496 from ruanwenjun/kyuubi-7495-pod-log-name.

Closes #7495

aa5bc55 [ruanwenjun] [KYUUBI #7495] Avoid overlong Kubernetes pod log names

Authored-by: ruanwenjun <wenjun@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 6f6e0eb)
Signed-off-by: Cheng Pan <chengpan@apache.org>
pan3793 pushed a commit that referenced this pull request Jun 10, 2026
### Why are the changes needed?

Kyuubi currently limits generated Spark driver pod names and executor pod name prefixes only against the Kubernetes pod name limit.

However, kubelet creates pod log directories with the `namespace_podName_podUID` format. When the generated pod name is close to the Kubernetes pod name limit, the log directory name can exceed the Linux path component limit and kubelet fails to create it.

This patch makes the generated driver pod name and executor pod name prefix reserve the kubelet pod log directory budget. Closes #7495.

### How was this patch tested?

- `env PATH="/tmp/kyuubi-black-22.3.0/bin:$PATH" dev/reformat`
- `git diff --check HEAD~1..HEAD`
- `build/mvn test -pl kyuubi-server -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.util.KubernetesPodNameSuite`
- `build/mvn test -pl externals/kyuubi-spark-sql-engine -am -Dtest=none -DwildcardSuites=org.apache.kyuubi.engine.spark.SparkSQLEngineSuite`

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

Assisted-by: OpenAI Codex (GPT-5)

Closes #7496 from ruanwenjun/kyuubi-7495-pod-log-name.

Closes #7495

aa5bc55 [ruanwenjun] [KYUUBI #7495] Avoid overlong Kubernetes pod log names

Authored-by: ruanwenjun <wenjun@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit 6f6e0eb)
Signed-off-by: Cheng Pan <chengpan@apache.org>
@pan3793

pan3793 commented Jun 10, 2026

Copy link
Copy Markdown
Member

thanks, merged for 1.12.0/1.11.2/1.10.4

@ruanwenjun ruanwenjun deleted the kyuubi-7495-pod-log-name branch June 10, 2026 10:34
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.

[Bug] Spark on Kubernetes generated pod names can exceed kubelet pod log directory name length

2 participants