Skip to content

Commit 2211387

Browse files
committed
[SPARK-53723] Support SparkCluster Sentinel Resource
1 parent 1b3930b commit 2211387

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

build-tools/helm/spark-kubernetes-operator/templates/workload-rbac.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,26 @@ spec:
177177
{{- end }}
178178
---
179179
{{- end }}
180+
{{- if $workloadResources.sparkClusterSentinel.create }}
181+
{{- range $sentinelNs := .Values.workloadResources.sparkClusterSentinel.sentinelNamespaces.data }}
182+
apiVersion: spark.apache.org/v1
183+
kind: SparkCluster
184+
metadata:
185+
name: {{ $workloadResources.sparkClusterSentinel.name }}
186+
namespace: {{ $sentinelNs }}
187+
labels:
188+
"spark.operator/sentinel": "true"
189+
{{- template "spark-operator.workloadLabels" $ }}
190+
annotations:
191+
{{- template "spark-operator.workloadAnnotations" $ }}
192+
spec:
193+
runtimeVersions:
194+
sparkVersion: "dummy"
195+
clusterTolerations:
196+
instanceConfig:
197+
initWorkers: 0
198+
minWorkers: 0
199+
maxWorkers: 0
200+
{{- end }}
201+
---
202+
{{- end }}

build-tools/helm/spark-kubernetes-operator/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ workloadResources:
159159
# When enabled, a sentinel resource of type SparkApp will be deployed to namespace(s) provided
160160
# Note that sentinelNamespaces list should be a subset of {workloadResources.namespaces.data}
161161
# - "default"
162+
sparkClusterSentinel:
163+
create: false
164+
name: "spark-cluster-sentinel"
165+
sentinelNamespaces:
166+
data:
167+
# - "spark-1"
168+
# - "spark-2"
169+
# When enabled, a sentinel resource of type SparkCluster will be deployed to namespace(s) provided
170+
# Note that sentinelNamespaces list should be a subset of {workloadResources.namespaces.data}
171+
# - "default"
162172
# workload resources are by default annotated to avoid workload abort due to operator upgrade
163173
annotations:
164174
"helm.sh/resource-policy": keep

docs/operations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ following table:
114114
| workloadResources.sparkApplicationSentinel.create | If enabled, sentinel resources will be created for operator to watch and reconcile for the health probe purpose. | false |
115115
| workloadResources.sparkApplicationSentinel.name | Name for sentinel resources. | "spark-app-sentinel" |
116116
| workloadResources.sparkApplicationSentinel.sentinelNamespaces | A list of namespaces where sentinel resources will be created in. Note that these namespaces have to be a subset of `workloadResources.namespaces.data`. | |
117+
| workloadResources.sparkClusterSentinel.create | If enabled, sentinel resources will be created for operator to watch and reconcile for the health probe purpose. | false |
118+
| workloadResources.sparkClusterSentinel.name | Name for sentinel resources. | "spark-cluster-sentinel" |
119+
| workloadResources.sparkClusterSentinel.sentinelNamespaces | A list of namespaces where sentinel resources will be created in. Note that these namespaces have to be a subset of `workloadResources.namespaces.data`. | |
117120
| operatorConfiguration.append | If set to true, below conf file & properties would be appended to default conf. Otherwise, they would override default properties. | true |
118121
| operatorConfiguration.log4j2.properties | The default log4j2 configuration. | Refer default [log4j2.properties](../build-tools/helm/spark-kubernetes-operator/conf/log4j2.properties) |
119122
| operatorConfiguration.spark-operator.properties | The default operator configuration. | |

0 commit comments

Comments
 (0)