Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
Signed-off-by: Yi Chen <[email protected]>
  • Loading branch information
ChenYi015 committed Aug 1, 2024
1 parent 15dbe99 commit 1d4d4bf
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 254 deletions.
53 changes: 0 additions & 53 deletions examples/spark-operator-with-metrics.yaml

This file was deleted.

94 changes: 0 additions & 94 deletions examples/spark-operator-with-webhook.yaml

This file was deleted.

38 changes: 19 additions & 19 deletions examples/spark-pi-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,41 +13,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "sparkoperator.k8s.io/v1beta2"
apiVersion: sparkoperator.k8s.io/v1beta2
kind: SparkApplication
metadata:
name: spark-pi
name: spark-pi-configmap
namespace: default
spec:
type: Scala
mode: cluster
image: "spark:3.5.0"
imagePullPolicy: Always
image: spark:3.5.0
imagePullPolicy: IfNotPresent
mainClass: org.apache.spark.examples.SparkPi
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar"
sparkVersion: "3.5.0"
mainApplicationFile: local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar
sparkVersion: 3.5.0
restartPolicy:
type: Never
volumes:
- name: config-vol
configMap:
name: dummy-cm
- name: config-vol
configMap:
name: test-configmap
driver:
cores: 1
coreLimit: "1200m"
memory: "512m"
labels:
version: 3.5.0
cores: 1
coreLimit: 1200m
memory: 512m
serviceAccount: spark-operator-spark
volumeMounts:
- name: config-vol
mountPath: /opt/spark/mycm
- name: config-vol
mountPath: /opt/spark/config
executor:
cores: 1
instances: 1
memory: "512m"
labels:
version: 3.5.0
instances: 1
cores: 1
memory: 512m
volumeMounts:
- name: config-vol
mountPath: /opt/spark/mycm
- name: config-vol
mountPath: /opt/spark/config
42 changes: 19 additions & 23 deletions examples/spark-pi-custom-resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,42 @@
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: "sparkoperator.k8s.io/v1beta2"
apiVersion: sparkoperator.k8s.io/v1beta2
kind: SparkApplication
metadata:
name: spark-pi-custom-resource
namespace: default
spec:
type: Scala
mode: cluster
image: "spark:3.5.0"
imagePullPolicy: Always
image: spark:3.5.0
imagePullPolicy: IfNotPresent
mainClass: org.apache.spark.examples.SparkPi
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar"
sparkVersion: "3.5.0"
mainApplicationFile: local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar
sparkVersion: 3.5.0
restartPolicy:
type: Never
volumes:
- name: "test-volume"
hostPath:
path: "/tmp"
type: Directory
- name: test-volume
hostPath:
path: /tmp
type: Directory
driver:
cores: 1
coreLimit: "1200m"
memory: "512m"
labels:
version: 3.5.0
cores: 1
coreLimit: 1200m
memory: 512m
serviceAccount: spark-operator-spark
volumeMounts:
- name: "test-volume"
mountPath: "/tmp"
- name: test-volume
mountPath: /tmp
executor:
cores: 1
instances: 1
memory: "512m"
labels:
version: 3.5.0
instances: 1
cores: 1
memory: 512m
volumeMounts:
- name: "test-volume"
mountPath: "/tmp"
batchSchedulerOptions:
resources:
cpu: "2"
memory: "4096m"
- name: test-volume
mountPath: /tmp
49 changes: 49 additions & 0 deletions examples/spark-pi-dynamic-allocation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# 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
#
# http://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: sparkoperator.k8s.io/v1beta2
kind: SparkApplication
metadata:
name: spark-pi-dynamic-allocation
namespace: default
spec:
type: Scala
mode: cluster
image: spark:3.5.0
imagePullPolicy: IfNotPresent
mainClass: org.apache.spark.examples.SparkPi
mainApplicationFile: local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar
sparkVersion: 3.5.0
arguments:
- "50000"
driver:
labels:
version: 3.5.0
cores: 1
coreLimit: 1200m
memory: 512m
serviceAccount: spark-operator-spark
executor:
labels:
version: 3.5.0
instances: 1
cores: 1
coreLimit: 1200m
memory: 512m
dynamicAllocation:
enabled: true
initialExecutors: 2
maxExecutors: 5
minExecutors: 1
18 changes: 9 additions & 9 deletions examples/spark-pi-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,39 @@
# limitations under the License.
#

apiVersion: "sparkoperator.k8s.io/v1beta2"
apiVersion: sparkoperator.k8s.io/v1beta2
kind: SparkApplication
metadata:
name: spark-pi
namespace: default
spec:
type: Scala
mode: cluster
image: "gcr.io/spark-operator/spark:v3.1.1-gcs-prometheus"
image: gcr.io/spark-operator/spark:v3.1.1-gcs-prometheus
imagePullPolicy: Always
mainClass: org.apache.spark.examples.SparkPi
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.1.1.jar"
mainApplicationFile: local:///opt/spark/examples/jars/spark-examples_2.12-3.1.1.jar
arguments:
- "100000"
sparkVersion: "3.1.1"
- "100000"
sparkVersion: 3.1.1
restartPolicy:
type: Never
driver:
cores: 1
coreLimit: "1200m"
memory: "512m"
coreLimit: 1200m
memory: 512m
labels:
version: 3.1.1
serviceAccount: spark-operator-spark
executor:
cores: 1
instances: 1
memory: "512m"
memory: 512m
labels:
version: 3.1.1
monitoring:
exposeDriverMetrics: true
exposeExecutorMetrics: true
prometheus:
jmxExporterJar: "/prometheus/jmx_prometheus_javaagent-0.11.0.jar"
jmxExporterJar: /prometheus/jmx_prometheus_javaagent-0.11.0.jar
port: 8090
Loading

0 comments on commit 1d4d4bf

Please sign in to comment.