Skip to content

Commit d87c685

Browse files
Fix examples (#2010)
Signed-off-by: Peter Jablonski <[email protected]>
1 parent 333ee0b commit d87c685

File tree

12 files changed

+61
-55
lines changed

12 files changed

+61
-55
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ helm-unittest:
4848
helm unittest charts/spark-operator-chart --strict
4949

5050
helm-lint:
51-
docker run --rm --workdir /workspace --volume $(PWD):/workspace quay.io/helmpack/chart-testing:latest ct lint
51+
docker run --rm --workdir /workspace --volume "$$(pwd):/workspace" quay.io/helmpack/chart-testing:latest ct lint
5252

5353
helm-docs:
5454
docker run --rm --volume "$$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:latest

charts/spark-operator-chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apiVersion: v2
22
name: spark-operator
33
description: A Helm chart for Spark on Kubernetes operator
4-
version: 1.2.14
5-
appVersion: v1beta2-1.4.5-3.5.0
4+
version: 1.2.15
5+
appVersion: v1beta2-1.4.6-3.5.0
66
keywords:
77
- spark
88
home: https://github.com/kubeflow/spark-operator

charts/spark-operator-chart/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# spark-operator
22

3-
![Version: 1.2.14](https://img.shields.io/badge/Version-1.2.14-informational?style=flat-square) ![AppVersion: v1beta2-1.4.5-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.4.5--3.5.0-informational?style=flat-square)
3+
![Version: 1.2.15](https://img.shields.io/badge/Version-1.2.15-informational?style=flat-square) ![AppVersion: v1beta2-1.4.6-3.5.0](https://img.shields.io/badge/AppVersion-v1beta2--1.4.6--3.5.0-informational?style=flat-square)
44

55
A Helm chart for Spark on Kubernetes operator
66

@@ -126,7 +126,7 @@ See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall) for command docum
126126
| serviceAccounts.sparkoperator.create | bool | `true` | Create a service account for the operator |
127127
| serviceAccounts.sparkoperator.name | string | `""` | Optional name for the operator service account |
128128
| sidecars | list | `[]` | Sidecar containers |
129-
| sparkJobNamespaces | list | `[]` | List of namespaces where to run spark jobs |
129+
| sparkJobNamespaces | list | `[""]` | List of namespaces where to run spark jobs |
130130
| tolerations | list | `[]` | List of node taints to tolerate |
131131
| uiService.enable | bool | `true` | Enable UI service creation for Spark application |
132132
| volumeMounts | list | `[]` | |

charts/spark-operator-chart/templates/spark-rbac.yaml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,8 @@ rules:
1414
- ""
1515
resources:
1616
- pods
17-
verbs:
18-
- "*"
19-
- apiGroups:
20-
- ""
21-
resources:
2217
- services
23-
verbs:
24-
- "*"
25-
- apiGroups:
26-
- ""
27-
resources:
2818
- configmaps
29-
verbs:
30-
- "*"
31-
- apiGroups:
32-
- ""
33-
resources:
3419
- persistentvolumeclaims
3520
verbs:
3621
- "*"

charts/spark-operator-chart/tests/spark-rbac_test.yaml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,27 @@ tests:
6060
kind: RoleBinding
6161
name: spark
6262

63-
- it: Should render multiple spark roles if sparkJobNamespaces is set
63+
- it: Should create a single spark role with namespace "" by default
64+
documentIndex: 0
65+
asserts:
66+
- containsDocument:
67+
apiVersion: rbac.authorization.k8s.io/v1
68+
kind: Role
69+
name: spark-role
70+
namespace: ""
71+
72+
- it: Should create a single spark role binding with namespace "" by default
73+
values:
74+
- ../values.yaml
75+
documentIndex: 1
76+
asserts:
77+
- containsDocument:
78+
apiVersion: rbac.authorization.k8s.io/v1
79+
kind: RoleBinding
80+
name: spark
81+
namespace: ""
82+
83+
- it: Should render multiple spark roles if sparkJobNamespaces is set with multiple values
6484
set:
6585
sparkJobNamespaces:
6686
- ns1
@@ -73,7 +93,7 @@ tests:
7393
name: spark-role
7494
namespace: ns1
7595

76-
- it: Should render multiple spark role bindings if sparkJobNamespaces is set
96+
- it: Should render multiple spark role bindings if sparkJobNamespaces is set with multiple values
7797
set:
7898
sparkJobNamespaces:
7999
- ns1
@@ -86,7 +106,7 @@ tests:
86106
name: spark
87107
namespace: ns1
88108

89-
- it: Should render multiple spark roles if sparkJobNamespaces is set
109+
- it: Should render multiple spark roles if sparkJobNamespaces is set with multiple values
90110
set:
91111
sparkJobNamespaces:
92112
- ns1
@@ -99,7 +119,7 @@ tests:
99119
name: spark-role
100120
namespace: ns2
101121

102-
- it: Should render multiple spark role bindings if sparkJobNamespaces is set
122+
- it: Should render multiple spark role bindings if sparkJobNamespaces is set with multiple values
103123
set:
104124
sparkJobNamespaces:
105125
- ns1

charts/spark-operator-chart/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ serviceAccounts:
5353
annotations: {}
5454

5555
# -- List of namespaces where to run spark jobs
56-
sparkJobNamespaces: []
56+
sparkJobNamespaces:
57+
- ""
5758
# - ns1
5859

5960
# -- Operator concurrency, higher values might increase memory usage

examples/spark-pi-configmap.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ metadata:
2121
spec:
2222
type: Scala
2323
mode: cluster
24-
image: "gcr.io/spark-operator/spark:v3.1.1"
24+
image: "spark:3.5.0"
2525
imagePullPolicy: Always
2626
mainClass: org.apache.spark.examples.SparkPi
27-
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.1.1.jar"
28-
sparkVersion: "3.1.1"
27+
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar"
28+
sparkVersion: "3.5.0"
2929
restartPolicy:
3030
type: Never
3131
volumes:
@@ -37,8 +37,8 @@ spec:
3737
coreLimit: "1200m"
3838
memory: "512m"
3939
labels:
40-
version: 3.1.1
41-
serviceAccount: spark
40+
version: 3.5.0
41+
serviceAccount: spark-operator-spark
4242
volumeMounts:
4343
- name: config-vol
4444
mountPath: /opt/spark/mycm
@@ -47,7 +47,7 @@ spec:
4747
instances: 1
4848
memory: "512m"
4949
labels:
50-
version: 3.1.1
50+
version: 3.5.0
5151
volumeMounts:
5252
- name: config-vol
5353
mountPath: /opt/spark/mycm

examples/spark-pi-custom-resource.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ metadata:
2121
spec:
2222
type: Scala
2323
mode: cluster
24-
image: "gcr.io/spark-operator/spark:v3.1.1"
24+
image: "spark:3.5.0"
2525
imagePullPolicy: Always
2626
mainClass: org.apache.spark.examples.SparkPi
27-
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.1.1.jar"
28-
sparkVersion: "3.1.1"
27+
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar"
28+
sparkVersion: "3.5.0"
2929
restartPolicy:
3030
type: Never
3131
volumes:
@@ -38,8 +38,8 @@ spec:
3838
coreLimit: "1200m"
3939
memory: "512m"
4040
labels:
41-
version: 3.1.1
42-
serviceAccount: spark
41+
version: 3.5.0
42+
serviceAccount: spark-operator-spark
4343
volumeMounts:
4444
- name: "test-volume"
4545
mountPath: "/tmp"
@@ -48,7 +48,7 @@ spec:
4848
instances: 1
4949
memory: "512m"
5050
labels:
51-
version: 3.1.1
51+
version: 3.5.0
5252
volumeMounts:
5353
- name: "test-volume"
5454
mountPath: "/tmp"

examples/spark-pi-prometheus.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
memory: "512m"
3838
labels:
3939
version: 3.1.1
40-
serviceAccount: spark
40+
serviceAccount: spark-operator-spark
4141
executor:
4242
cores: 1
4343
instances: 1

examples/spark-pi-schedule.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ spec:
2525
template:
2626
type: Scala
2727
mode: cluster
28-
image: "gcr.io/spark-operator/spark:v3.1.1"
28+
image: "spark:3.5.0"
2929
imagePullPolicy: Always
3030
mainClass: org.apache.spark.examples.SparkPi
31-
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.1.1.jar"
32-
sparkVersion: "3.1.1"
31+
mainApplicationFile: "local:///opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar"
32+
sparkVersion: "3.5.0"
3333
restartPolicy:
3434
type: Never
3535
driver:
3636
cores: 1
3737
coreLimit: "1200m"
3838
memory: "512m"
3939
labels:
40-
version: 3.1.1
41-
serviceAccount: spark
40+
version: 3.5.0
41+
serviceAccount: spark-operator-spark
4242
executor:
4343
cores: 1
4444
instances: 1
4545
memory: "512m"
4646
labels:
47-
version: 3.1.1
47+
version: 3.5.0

0 commit comments

Comments
 (0)