[KYUUBI #7756][KUBERNETES] Support owner-scoped application watches - #7757
Open
ruanwenjun wants to merge 4 commits into
Open
ruanwenjun wants to merge 4 commits into
ruanwenjun wants to merge 4 commits into
Conversation
ruanwenjun
force-pushed
the
kyuubi-7756-owner-scoped-kubernetes-watch
branch
from
September 20, 2026 13:02
2ad6cd3 to
73f9aff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
Closes #7756.
In multi-server Kubernetes deployments, each Kyuubi server currently receives events for every Kyuubi Spark Driver Pod in the namespace. When Spark UI URLs use Services, each server also receives all Service events in that namespace. This duplicates API server watch delivery and client-side informer processing across replicas.
This patch adds the optional
kyuubi.kubernetes.application.ownerScopedWatch.enabledconfiguration and labels Spark Driver Pods and Driver Services withkyuubi.apache.org/watch-scope:CONNECTIONandSERVER_LOCALengines use the submitting Kyuubi server address.USER,GROUP, andSERVERengines useglobalbecause they can be shared across Kyuubi servers.globalso their status remains observable through any Kyuubi server after load balancing or submitter failure.When the option is enabled, each Kyuubi server keeps a single Pod informer and, when required for Spark UI URLs, a single Service informer per Kubernetes context and namespace. Both informers use
kyuubi.apache.org/watch-scope in (<server-address>,global)so a server receives events for its local-scope engines and all cross-server applications. When disabled, the existing unscoped watch behavior is preserved.The watch-scope label is added regardless of whether scoped watches are enabled, which supports enabling the option after a rolling upgrade. Server addresses must be unique across Kyuubi servers. Applications created by older versions without the label are not observed after scoped watches are enabled, so deployments should keep the option disabled until those applications have terminated.
IPv4 addresses are used directly. IPv6 addresses are encoded as deterministic hexadecimal Kubernetes label values.
How was this patch tested?
The Spark process-builder suites compiled successfully but could not be executed locally because
SPARK_HOMEis not available. The fulldev/reformatcommand was also blocked because the local Black version is 25.1.0 while the project requires 22.3.0; scoped Spotless apply and check completed successfully for the affected modules.Was this patch assisted by generative AI tooling?
Assisted-by: Command Code
Assisted-by: Codex with GPT-5