Skip to content

workspaces: add Spark Connect operator and user guides for notebooks and workspaces - #4479

Open
vikas-saxena02 wants to merge 19 commits into
kubeflow:masterfrom
vikas-saxena02:docs-workspaces-spark-connect
Open

vikas-saxena02 wants to merge 19 commits into
kubeflow:masterfrom
vikas-saxena02:docs-workspaces-spark-connect

Conversation

@vikas-saxena02

@vikas-saxena02 vikas-saxena02 commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Drafted with the help of Claude.

Description of Changes

Adds guides for running Spark from a Kubeflow notebook pod with the Kubeflow SDK, so
users can start a Spark Connect session without hand-writing SparkApplication
manifests. Covers both Notebooks and Workspaces, since Workspaces is still beta and
Notebooks is what most users are running today.

All pages are deliberately short and defer the detail to the integration tests in
kubeflow/community-distribution, which CI keeps green on every pull request. Anything
that would date quickly — the per-session pod settings, the client/server version
pairing — lives there rather than here.

notebooks/spark-connect.md — the permission check, installing the client, a minimal
SparkClient.connect() example, and releasing the session. No administrator setup is
documented because none is needed: a notebook pod runs as default-editor, which a
Profile already binds to kubeflow-edit, and the aggregated kubeflow-spark-edit
ClusterRole carries sparkconnects.

workspaces/user-guides/spark-connect.md — the same flow for a Workspace. The only
pod-level setting shown is the driver ServiceAccount, via Driver(service_account=...).

workspaces/operator-guides/spark-connect.md — the one change an administrator must
make for Workspaces, binding kubeflow-spark-edit to the WorkspaceKind's ServiceAccount,
and why Spark pods have to stay out of the service mesh. Workspaces v2.0.0-beta.0 stopped
granting the Kubeflow ClusterRoles to ws-{WORKSPACE_NAME}, which is why this step exists
for Workspaces and not for Notebooks.

workspaces/user-guides/_index.md — new section landing page.

The mesh exclusion is presented as a platform concern in both guides rather than something
a data scientist configures. Its root cause is upstream:
SPARK-42411.

Changes since the first revision, from review:

  • Pages cut by roughly half, with the detail replaced by links to the tested examples
    (@juliusvonkohout).
  • The pod template overrides are gone from the user guides. The driver ServiceAccount now
    uses the connect API's own field, and the Istio content moved out of the user-facing
    flow (@tariq-hasan).
  • The "Image requirements" section is removed. The version pairing is handled, and tested,
    in the community-distribution test scripts, and chore(spark): replace pyspark-connect with pyspark-client (#781) sdk#795 is changing the
    underlying package anyway.
  • Notebooks coverage added alongside Workspaces.

Both tests the guides link to are merged in kubeflow/community-distribution and share one
session script, so the Notebooks and Workspaces examples are the same code exercised from
two pod types.

Related Issues

Related: kubeflow/notebooks#1362

Checklist

@vikas-saxena02 vikas-saxena02 changed the title workspaces: add Spark Connect operator and user guides notebooks: (actually its workspaces) add Spark Connect operator and user guides Sep 4, 2026
@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@nabuskey @tariq-hasan @juliusvonkohout can I please get a review on this

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

/retest

@tariq-hasan tariq-hasan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @vikas-saxena02! I have added a few comments.

Comment thread content/en/docs/components/workspaces/user-guides/spark-connect.md Outdated
Comment thread content/en/docs/components/workspaces/operator-guides/spark-connect.md Outdated
Comment thread content/en/docs/components/workspaces/user-guides/spark-connect.md
Comment thread content/en/docs/components/workspaces/user-guides/spark-connect.md Outdated
Comment thread content/en/docs/components/workspaces/user-guides/spark-connect.md Outdated

@juliusvonkohout juliusvonkohout left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you can shorten it a lot and ease the maintenance if you just link to https://github.com/kubeflow/community-distribution/blob/master/.github/workflows/workspaces_spark_connect_test.yaml

We do the same for kserve. just the high level and a link to constantly tested automation to reduce the maintenance and prevent it from becoming outdated.

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

I think you can shorten it a lot and ease the maintenance if you just link to https://github.com/kubeflow/community-distribution/blob/master/.github/workflows/workspaces_spark_connect_test.yaml

We do the same for kserve. just the high level and a link to constantly tested automation to reduce the maintenance and prevent it from becoming outdated.

@juliusvonkohout can you please share the link to the documentation for kserve and I will align it to the same.

@juliusvonkohout

Copy link
Copy Markdown
Member

https://www.kubeflow.org/docs/ecosystem/kserve/ but we actually need to clean it up. The kswrve documentation also looks heavily outdated. Feel free to also raise a PR to clean up kswrve. Another reference is https://www.kubeflow.org/docs/components/pipelines/operator-guides/installation/

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

/hold

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@juliusvonkohout @christian-heusel i ahve raised kubeflow/community-distribution#3631 with an updated example, this code works with sdk v0.4.0, 0.5.0 and the code in main/master branch ... once this is merged, i will update this pr with the link the example added in community distribution repo

@juliusvonkohout

juliusvonkohout commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

@juliusvonkohout @christian-heusel i ahve raised kubeflow/community-distribution#3631 with an updated example, this code works with sdk v0.4.0, 0.5.0 and the code in main/master branch ... once this is merged, i will update this pr with the link the example added in community distribution repo

merged, please update and better just link to the test in the community distribution and reduce this PR here by 50 %. Otherwise this page can get outdated quite fast.

@christian-heusel

Copy link
Copy Markdown
Member

/retitle workspaces: add Spark Connect operator and user guides

@google-oss-prow google-oss-prow Bot changed the title notebooks: (actually its workspaces) add Spark Connect operator and user guides workspaces: add Spark Connect operator and user guides Oct 15, 2026
@vikas-saxena02
vikas-saxena02 force-pushed the docs-workspaces-spark-connect branch from 2de331c to c6cc525 Compare October 15, 2026 22:11
@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@juliusvonkohout @tariq-hasan @nabuskey @andreyvelich @christian-heusel PR has been updated with help from claude. Please review and advise if any chnages are to be made

/hold cancel

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@thesuperzapper your review will be valuable as well

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@juliusvonkohout @christian-heusel i ahve raised kubeflow/community-distribution#3631 with an updated example, this code works with sdk v0.4.0, 0.5.0 and the code in main/master branch ... once this is merged, i will update this pr with the link the example added in community distribution repo

merged, please update and better just link to the test in the community distribution and reduce this PR here by 50 %. Otherwise this page can get outdated quite fast.

@juliusvonkohout review comment addressed, please review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The installation instructions omit the client/server version-alignment prerequisite used by the referenced integration test.

2 open findings
What changed in this PR

Adds operator and user documentation for running Spark Connect sessions from Kubeflow Workspaces through the SDK.

Changes:

  • Documents permissions, session creation, and cleanup.
  • Explains administrator access grants and service-mesh considerations.
  • Adds a user-guides landing page and links to tested deployment examples.
File Description
content/​en/​docs/​components/​workspaces/​user-guides/​spark-connect.md Introduces the Spark session workflow.
content/​en/​docs/​components/​workspaces/​user-guides/​_index.md Adds the user-guides landing page.
content/​en/​docs/​components/​workspaces/​operator-guides/​spark-connect.md Documents platform prerequisites and reference configuration.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread content/en/docs/components/workspaces/user-guides/spark-connect.md
Comment thread content/en/docs/components/workspaces/operator-guides/spark-connect.md Outdated
@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

community distribution needs similar test for notebooks v1 as well

/hold

@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

both items fixed for good.. sorry i didnt realise the push failed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The guides omit the Kubeflow-specific Spark role prerequisite, leaving upstream-chart installations without the permissions needed to follow the examples.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Low severity Add Spark aggregated roles prerequisite and qualify permissions claim

content/​en/​docs/​components/​workspaces/​operator-guides/​spark-connect.md:20

The upstream Spark Operator chart does not install kubeflow-spark-edit, so an administrator can satisfy this prerequisite but still have no role to grant to Workspaces. Add the community distribution's Spark aggregated roles as a prerequisite, and qualify the automatic-permissions claim in content/en/docs/components/notebooks/spark-connect.md:11 with the same requirement.

Review effort: Balanced

@vikas-saxena02
vikas-saxena02 force-pushed the docs-workspaces-spark-connect branch from 2f910bc to 5193290 Compare October 26, 2026 22:48
@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

🔵 Needs a closer look

The guides omit the Kubeflow-specific Spark role prerequisite, leaving upstream-chart installations without the permissions needed to follow the examples.

No open issues 🎉

1 previously missed issue
In code that hasn't changed since last review

Low severity Add Spark aggregated roles prerequisite and qualify permissions claim
content/​en/​docs/​components/​workspaces/​operator-guides/​spark-connect.md:20

The upstream Spark Operator chart does not install kubeflow-spark-edit, so an administrator can satisfy this prerequisite but still have no role to grant to Workspaces. Add the community distribution's Spark aggregated roles as a prerequisite, and qualify the automatic-permissions claim in content/en/docs/components/notebooks/spark-connect.md:11 with the same requirement.

Review effort: Balanced

Addressd!!

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
…mple

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
… example

Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
Signed-off-by: Vikas Saxena <Vikas.Saxena.2006@gmail.com>
@vikas-saxena02
vikas-saxena02 force-pushed the docs-workspaces-spark-connect branch from 2d5bc5b to 4de4004 Compare October 27, 2026 19:38
@vikas-saxena02

Copy link
Copy Markdown
Contributor Author

@juliusvonkohout @tariq-hasan can you please review this again!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/notebooks AREA: Kubeflow Notebooks size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants