← Back to Pull requests

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

Closed
unknown closed this pull request without merging on Nov 11, 2026 15:05 UTC
View on GitHub
unknown unknown commented on Sep 04, 2026 17:16 UTC
Author

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 kubeflow/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

  • You have signed off your commits

  • Ensure you follow best practices from our contributing guide.

  • (for big changes) I will post screenshots of the changes in a PR comment
  • Diff: 397 lines (+297 / -100) across 4 files Reviewer: juliusvonkohout Review duration: 97789m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.48 · 397 lines diff across 4 files
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #4479"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48.2% (MEDIUM) · Higher = larger blast radius
    48.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19% · Safe to merge
    19%