Files
spark-operator/config/spark-rbac/spark-application-rbac.yaml
Rishabh SinghandGitHub 20c122c4c7 feat(kustomize): Add core deployment infrastructure and E2E test suite (#2919)
- Add complete Kustomize manifests in config/ for deploying the Spark
  Operator without Helm
- Tighten webhook ClusterRole to least privilege
- Add DEPLOY_METHOD=kustomize support in test/e2e/suite_test.go so the
  same Ginkgo e2e suite runs against both Helm and Kustomize
- Replace bash test scripts with Go kustomize lint test
  (test/kustomize/kustomize_build_test.go)
- Fix subPath removal in webhook deployment, rename Namespace to
  spark-operator, quote empty apiGroups in kubebuilder RBAC markers

fix(kustomize): Align naming, RBAC, and service config with Helm chart

- Rename all resources to spark-operator-{controller,webhook} for
  consistency with Helm
- Rename webhook Service from webhook-service to spark-operator-webhook-svc,
  add named port (webhook), and use named targetPort
- Add replacements directive to propagate Service name into webhook
  configurations (survives controller-gen regeneration of manifests.yaml)
- Expand webhook ClusterRole: add events, pods, resourcequotas (get/list/watch),
  scheduledsparkapplications, and status/finalizers subresources
- Add events: create,patch to webhook Role for leader election
- Fix kustomizeconfig.yaml namespace.create: true → false
- Remove params.env and ConfigMap-based image parameterization; replace
  with kustomize images directive using newTag from VERSION file
  (simpler, standard kustomize pattern, updated via make kustomize-set-image)
- UpdateRD patches to reference new webhook service name



refactor(kustomize): Address PR review - extract spark RBAC, fix test image handling

- Move spark-job RBAC (SA, Role, RoleBinding) from config/rbac/ to
  config/spark-rbac/ as a standalone kustomization that users apply to
  application namespaces separately from operator infrastructure
- Remove hardcoded fallback image from installViaKustomize(); only
  override kustomization.yaml when SPARK_OPERATOR_IMAGE is explicitly set
- Remove events permission from webhook Role (kept in ClusterRole for
  Helm parity)
- Replace programmatic createSparkJobRBAC/cleanupSparkJobRBAC with
  kubectl apply/delete -k config/spark-rbac/ -n default
- Update lint test resource counts to reflect new architecture
- fix(test): Use IMAGE_TAG instead of SPARK_OPERATOR_IMAGE for Kustomize e2e

Signed-off-by: roburishabh <[email protected]>
2026-05-05 15:57:46 +00:00

54 lines
1.2 KiB
YAML

#
# Copyright 2024 The Kubeflow authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
apiVersion: v1
kind: ServiceAccount
metadata:
name: spark-operator-spark
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: spark-role
rules:
- apiGroups:
- ""
resources:
- pods
- configmaps
- persistentvolumeclaims
- services
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- deletecollection
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: spark-role-binding
subjects:
- kind: ServiceAccount
name: spark-operator-spark
roleRef:
kind: Role
name: spark-role
apiGroup: rbac.authorization.k8s.io