You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
website: add Kustomize installation docs for Spark Operator
Add Kustomize as a first-class installation path alongside Helm in the
Spark Operator getting-started guide. This includes install, configuration,
upgrade, uninstall, and RBAC setup instructions for Kustomize users.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ali Maredia <amaredia@redhat.com>
See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade) for command documentation.
71
76
72
-
### Uninstall the Chart
77
+
####Uninstall the Chart
73
78
74
79
```shell
75
80
helm uninstall [RELEASE_NAME]
@@ -79,30 +84,119 @@ This removes all the Kubernetes resources associated with the chart and deletes
79
84
80
85
See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall) for command documentation.
81
86
82
-
### Additional Steps to Integrate Jupyter Notebooks
87
+
### Install with Kustomize
83
88
84
-
Integrating Jupyter Notebooks with the Spark Operator to run big data or distributed machine learning jobs with PySpark.
89
+
Kustomize support is available starting from Spark Operator v2.5.1. You will need `kubectl` v1.14+ (which includes built-in Kustomize support) or a standalone [kustomize](https://kubectl.docs.kubernetes.io/installation/kustomize/) binary.
85
90
86
-
See [Integration with Notebooks](../user-guide/notebooks-spark-operator)for further details.
91
+
To install using Kustomize, clone the release branch of the [Spark Operator repository](https://github.com/kubeflow/spark-operator)and apply the default configuration:
- Controller Deployment (1 replica) with ServiceAccount, ClusterRole, and leader-election Role
106
+
- Webhook Deployment (1 replica) with ServiceAccount, ClusterRole, Role, Service, and self-signed TLS
107
+
- MutatingWebhookConfiguration and ValidatingWebhookConfiguration
108
+
109
+
The webhook generates its own TLS certificates at startup (no cert-manager required by default).
110
+
111
+
Verify the operator is running:
91
112
92
113
```shell
93
-
kubectl apply -f examples/spark-pi.yaml
114
+
kubectl -n spark-operator get pods
94
115
```
95
116
96
-
Note that `spark-pi.yaml` configures the driver pod to use the `spark` service account to communicate with the Kubernetes API server. You might need to replace it with the appropriate service account before submitting the job. If you installed the operator using the Helm chart and overrode `spark.jobNamespaces`, the service account name ends with `-spark` and starts with the Helm release name. For example, if you would like to run your Spark jobs to run in a namespace called `test-ns`, first make sure it already exists, and then install the chart with the command:
117
+
#### Configuration with Kustomize
118
+
119
+
Unlike Helm values, kustomize parameters are edited directly in the manifest files or via overlays.
120
+
121
+
| What to change | Where to [edit](https://github.com/kubeflow/spark-operator)|
122
+
|---|---|
123
+
| Operator namespace |`namespace:` in `config/default/kustomization.yaml`|
124
+
| Image tag |`images:` block in `config/default/kustomization.yaml`, or run `make kustomize-set-image`|
Then the chart will set up a service account for your Spark jobs to use in that namespace.
163
+
**Warning:**`kubectl delete -k config/default` will also remove the CRDs, which deletes all SparkApplication, ScheduledSparkApplication, and SparkConnect resources cluster-wide.
164
+
165
+
## Running the Examples
166
+
167
+
Spark driver and executor pods need a Spark-specific service account to communicate with the Kubernetes API server. The setup differs depending on your installation method.
168
+
169
+
### Helm RBAC setup
170
+
171
+
If you installed the operator using the Helm chart and overrode `spark.jobNamespaces`, the chart automatically creates a service account in the specified namespace. The service account name ends with `-spark` and starts with the Helm release name.
172
+
173
+
For example, if you would like your Spark jobs to run in a namespace called `test-ns`, first make sure it already exists, and then install the chart with the command:
See the section on the [Spark Job Namespace](#about-spark-job-namespaces) for details on the behavior of the default Spark Job Namespace.
105
180
181
+
### Kustomize RBAC setup
182
+
183
+
If you installed the operator using Kustomize manifests, the service account and other RBAC resources must be created manually in each job namespace:
184
+
185
+
```shell
186
+
# For jobs run in the default namespace
187
+
kubectl -n default apply -k config/spark-rbac
188
+
```
189
+
190
+
See the section on [Spark RBAC](#about-the-service-account-for-driver-pods) for details on the RBAC resources needed for Spark jobs.
191
+
192
+
### Run the Spark PI example
193
+
194
+
To run the Spark PI example, run the following command:
195
+
196
+
```shell
197
+
kubectl apply -f examples/spark-pi.yaml
198
+
```
199
+
106
200
Running the above command will create a `SparkApplication` object named `spark-pi`. Check the object by running the following command:
107
201
108
202
```shell
@@ -177,9 +271,15 @@ Events:
177
271
178
272
The operator submits the Spark Pi example to run once it receives an event indicating the `SparkApplication` object was added.
179
273
274
+
## Additional Steps to Integrate Jupyter Notebooks
275
+
276
+
Integrating Jupyter Notebooks with the Spark Operator to run big data or distributed machine learning jobs with PySpark.
277
+
278
+
See [Integration with Notebooks](../user-guide/notebooks-spark-operator) for further details.
279
+
180
280
## Configuration
181
281
182
-
The operator is typically deployed and run using the Helm chart. However, users can still run it outside a Kubernetes cluster and make it talk to the Kubernetes API server of a cluster by specifying path to `kubeconfig`, which can be done using the `-kubeconfig` flag.
282
+
The operator is typically deployed and run using the Helm chart or Kustomize manifests. However, users can still run it outside a Kubernetes cluster and make it talk to the Kubernetes API server of a cluster by specifying path to `kubeconfig`, which can be done using the `-kubeconfig` flag.
183
283
184
284
The operator uses multiple workers in the `SparkApplication` controller. The number of worker threads are controlled using command-line flag `-controller-threads` which has a default value of 10.
185
285
@@ -191,16 +291,6 @@ The mutating admission webhook is an **optional** component and can be enabled o
191
291
192
292
By default, the operator will manage custom resource objects of the managed CRD types for the whole cluster. It can be configured to manage only the custom resource objects in a specific namespace with the flag `-namespace=<namespace>`
193
293
194
-
## Upgrade
195
-
196
-
To upgrade the operator, e.g., to use a newer version container image with a new tag, run the following command with updated parameters for the Helm release:
Refer to the Helm [documentation](https://helm.sh/docs/helm/helm_upgrade/) for more details on `helm upgrade`.
203
-
204
294
## About Spark Job Namespaces
205
295
206
296
The Spark Job Namespaces value defines the namespaces where `SparkApplications` can be deployed. The Helm chart value for the Spark Job Namespaces is `spark.jobNamespaces`, and its default value is `[]`. When the list of namespaces is empty the Helm chart will create a service account in the namespace where the spark-operator is deployed.
@@ -211,7 +301,7 @@ The Spark Operator uses the Spark Job Namespace to identify and filter relevant
211
301
212
302
## About the Service Account for Driver Pods
213
303
214
-
A Spark driver pod need a Kubernetes service account in the pod's namespace that has permissions to create, get, list, and delete executor pods, and create a Kubernetes headless service for the driver. The driver will fail and exit without the service account, unless the default service account in the pod's namespace has the needed permissions. To submit and run a `SparkApplication` in a namespace, please make sure there is a service account with the permissions in the namespace and set `.spec.driver.serviceAccount` to the name of the service account. Please refer to [spark-rbac.yaml](https://github.com/kubeflow/spark-operator/blob/master/config/rbac/spark-application-rbac.yaml) for an example RBAC setup that creates a driver service account named `spark-operator-spark` in the `default` namespace, with a RBAC role binding giving the service account the needed permissions.
304
+
A Spark driver pod need a Kubernetes service account in the pod's namespace that has permissions to create, get, list, and delete executor pods, and create a Kubernetes headless service for the driver. The driver will fail and exit without the service account, unless the default service account in the pod's namespace has the needed permissions. To submit and run a `SparkApplication` in a namespace, please make sure there is a service account with the permissions in the namespace and set `.spec.driver.serviceAccount` to the name of the service account. Please refer to [spark-application-rbac.yaml](https://github.com/kubeflow/spark-operator/blob/master/config/spark-rbac/spark-application-rbac.yaml) for an example RBAC setup that creates a driver service account named `spark-operator-spark` in the `default` namespace, with a RBAC role binding giving the service account the needed permissions.
0 commit comments