Skip to content

fix(crd): Add missing SparkConnect CRD resource and patches to kustomization#2890

Open
RobuRishabh wants to merge 1 commit intokubeflow:masterfrom
RobuRishabh:fix-CRD-Kustomization-Bugs
Open

fix(crd): Add missing SparkConnect CRD resource and patches to kustomization#2890
RobuRishabh wants to merge 1 commit intokubeflow:masterfrom
RobuRishabh:fix-CRD-Kustomization-Bugs

Conversation

@RobuRishabh
Copy link
Copy Markdown
Contributor

Purpose of this PR

The config/crd/kustomization.yaml was missing the SparkConnect CRD resource and its corresponding webhook and CA injection patches. This caused a significant feature gap where Kustomize users could not access SparkConnect features (Spark 3.4+), despite the base CRD manifest, controller reconciler, and admission webhooks all being in place.

This is a follow-up to PR #2820, which fixed the duplicate webhook patch and added missing ScheduledSparkApplication patches.

Proposed changes:

  • Add bases/sparkoperator.k8s.io_sparkconnects.yaml to the resources list in config/crd/kustomization.yaml
  • Create patches/webhook_in_sparkconnects.yaml to enable conversion webhook for the SparkConnect CRD
  • Create patches/cainjection_in_sparkconnects.yaml to enable cert-manager CA injection for the SparkConnect CRD
  • Add both patches to kustomization.yaml under the appropriate webhook and certmanager sections

Change Category

  • Bugfix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that could affect existing functionality)
  • Documentation update

Rationale

The SparkConnect CRD base manifest (bases/sparkoperator.k8s.io_sparkconnects.yaml) already exists and is generated by controller-gen. The controller registers a reconciler for SparkConnect in cmd/operator/controller/start.go, and the webhook server registers both mutating and validating admission hooks for SparkConnect in cmd/operator/webhook/start.go and config/webhook/manifests.yaml. However, the Kustomize configuration never included this CRD, meaning kustomize build config/crd only produced 2 CRDs instead of the expected 3. This brings Kustomize deployments to full parity with Helm.

Checklist

  • I have conducted a self-review of my own code.
  • I have updated documentation accordingly.
  • I have added tests that prove my changes are effective or that my feature works.
  • Existing unit tests pass locally with my changes.

…ization

This commit:
- Adds bases/sparkoperator.k8s.io_sparkconnects.yaml to the resources list
- Creates webhook_in_sparkconnects.yaml for conversion webhook support
- Creates cainjection_in_sparkconnects.yaml for cert-manager CA injection
- Adds both patches to kustomization.yaml

Signed-off-by: roburishabh <roburishabh@outlook.com>
Copilot AI review requested due to automatic review settings March 23, 2026 20:20
@google-oss-prow
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yuchaoran2011 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the CRD kustomize package to include the missing SparkConnect CRD and aligns it with the existing pattern used for SparkApplication and ScheduledSparkApplication, ensuring Kustomize-based installs can use SparkConnect (Spark 3.4+).

Changes:

  • Add the SparkConnect CRD base manifest to config/crd/kustomization.yaml resources.
  • Add a conversion webhook patch for the SparkConnect CRD.
  • Add a (commented, opt-in) cert-manager CA injection patch for the SparkConnect CRD.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
config/crd/kustomization.yaml Includes SparkConnect CRD and wires in webhook + (optional) CA injection patches consistent with existing CRDs.
config/crd/patches/webhook_in_sparkconnects.yaml Enables CRD conversion webhook for SparkConnect via the same service/path pattern as other CRDs.
config/crd/patches/cainjection_in_sparkconnects.yaml Adds cert-manager CA injection annotation for SparkConnect CRD (matching existing placeholder convention).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants