Skip to content

Commit b48436f

Browse files
committed
use standard configmap-backed volume
1 parent 8b36ff1 commit b48436f

File tree

9 files changed

+20
-251
lines changed

9 files changed

+20
-251
lines changed

deploy/crd/sparkapplication.crd.yaml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -85,34 +85,6 @@ spec:
8585
driver:
8686
nullable: true
8787
properties:
88-
configMapMounts:
89-
items:
90-
description: VolumeMount describes a mounting of a Volume within a container.
91-
properties:
92-
mountPath:
93-
description: "Path within the container at which the volume should be mounted. Must not contain ':'."
94-
type: string
95-
mountPropagation:
96-
description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10."
97-
type: string
98-
name:
99-
description: This must match the Name of a Volume.
100-
type: string
101-
readOnly:
102-
description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false."
103-
type: boolean
104-
subPath:
105-
description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
106-
type: string
107-
subPathExpr:
108-
description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive."
109-
type: string
110-
required:
111-
- mountPath
112-
- name
113-
type: object
114-
nullable: true
115-
type: array
11688
coreLimit:
11789
nullable: true
11890
type: string
@@ -237,34 +209,6 @@ spec:
237209
executor:
238210
nullable: true
239211
properties:
240-
configMapMounts:
241-
items:
242-
description: VolumeMount describes a mounting of a Volume within a container.
243-
properties:
244-
mountPath:
245-
description: "Path within the container at which the volume should be mounted. Must not contain ':'."
246-
type: string
247-
mountPropagation:
248-
description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10."
249-
type: string
250-
name:
251-
description: This must match the Name of a Volume.
252-
type: string
253-
readOnly:
254-
description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false."
255-
type: boolean
256-
subPath:
257-
description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
258-
type: string
259-
subPathExpr:
260-
description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive."
261-
type: string
262-
required:
263-
- mountPath
264-
- name
265-
type: object
266-
nullable: true
267-
type: array
268212
cores:
269213
format: uint
270214
minimum: 0.0

deploy/helm/spark-k8s-operator/crds/crds.yaml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -87,34 +87,6 @@ spec:
8787
driver:
8888
nullable: true
8989
properties:
90-
configMapMounts:
91-
items:
92-
description: VolumeMount describes a mounting of a Volume within a container.
93-
properties:
94-
mountPath:
95-
description: "Path within the container at which the volume should be mounted. Must not contain ':'."
96-
type: string
97-
mountPropagation:
98-
description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10."
99-
type: string
100-
name:
101-
description: This must match the Name of a Volume.
102-
type: string
103-
readOnly:
104-
description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false."
105-
type: boolean
106-
subPath:
107-
description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
108-
type: string
109-
subPathExpr:
110-
description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive."
111-
type: string
112-
required:
113-
- mountPath
114-
- name
115-
type: object
116-
nullable: true
117-
type: array
11890
coreLimit:
11991
nullable: true
12092
type: string
@@ -239,34 +211,6 @@ spec:
239211
executor:
240212
nullable: true
241213
properties:
242-
configMapMounts:
243-
items:
244-
description: VolumeMount describes a mounting of a Volume within a container.
245-
properties:
246-
mountPath:
247-
description: "Path within the container at which the volume should be mounted. Must not contain ':'."
248-
type: string
249-
mountPropagation:
250-
description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10."
251-
type: string
252-
name:
253-
description: This must match the Name of a Volume.
254-
type: string
255-
readOnly:
256-
description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false."
257-
type: boolean
258-
subPath:
259-
description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
260-
type: string
261-
subPathExpr:
262-
description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive."
263-
type: string
264-
required:
265-
- mountPath
266-
- name
267-
type: object
268-
nullable: true
269-
type: array
270214
cores:
271215
format: uint
272216
minimum: 0.0

deploy/manifests/crds.yaml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -88,34 +88,6 @@ spec:
8888
driver:
8989
nullable: true
9090
properties:
91-
configMapMounts:
92-
items:
93-
description: VolumeMount describes a mounting of a Volume within a container.
94-
properties:
95-
mountPath:
96-
description: "Path within the container at which the volume should be mounted. Must not contain ':'."
97-
type: string
98-
mountPropagation:
99-
description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10."
100-
type: string
101-
name:
102-
description: This must match the Name of a Volume.
103-
type: string
104-
readOnly:
105-
description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false."
106-
type: boolean
107-
subPath:
108-
description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
109-
type: string
110-
subPathExpr:
111-
description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive."
112-
type: string
113-
required:
114-
- mountPath
115-
- name
116-
type: object
117-
nullable: true
118-
type: array
11991
coreLimit:
12092
nullable: true
12193
type: string
@@ -240,34 +212,6 @@ spec:
240212
executor:
241213
nullable: true
242214
properties:
243-
configMapMounts:
244-
items:
245-
description: VolumeMount describes a mounting of a Volume within a container.
246-
properties:
247-
mountPath:
248-
description: "Path within the container at which the volume should be mounted. Must not contain ':'."
249-
type: string
250-
mountPropagation:
251-
description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10."
252-
type: string
253-
name:
254-
description: This must match the Name of a Volume.
255-
type: string
256-
readOnly:
257-
description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false."
258-
type: boolean
259-
subPath:
260-
description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
261-
type: string
262-
subPathExpr:
263-
description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive."
264-
type: string
265-
required:
266-
- mountPath
267-
- name
268-
type: object
269-
nullable: true
270-
type: array
271215
cores:
272216
format: uint
273217
minimum: 0.0

docs/modules/ROOT/examples/example-sparkapp-configmap.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ spec:
1414
- name: job-deps
1515
persistentVolumeClaim:
1616
claimName: pvc-ksv
17+
- name: cm-job-arguments
18+
configMap:
19+
name: cm-job-arguments # <4>
1720
args:
18-
- "--input /arguments/job-args.txt" # <4>
21+
- "--input /arguments/job-args.txt" # <5>
1922
sparkConf:
2023
"spark.hadoop.fs.s3a.aws.credentials.provider": "org.apache.hadoop.fs.s3a.AnonymousAWSCredentialsProvider"
2124
"spark.driver.extraClassPath": "/dependencies/jars/hadoop-aws-3.2.0.jar:/dependencies/jars/aws-java-sdk-bundle-1.11.375.jar"
@@ -27,16 +30,14 @@ spec:
2730
volumeMounts:
2831
- name: job-deps
2932
mountPath: /dependencies
30-
configMapMounts:
31-
- name: cm-job-arguments # <5>
32-
mountPath: /arguments # <6>
33+
- name: cm-job-arguments # <6>
34+
mountPath: /arguments # <7>
3335
executor:
3436
cores: 1
3537
instances: 3
3638
memory: "512m"
3739
volumeMounts:
3840
- name: job-deps
3941
mountPath: /dependencies
40-
configMapMounts:
41-
- name: cm-job-arguments # <5>
42-
mountPath: /arguments # <6>
42+
- name: cm-job-arguments # <6>
43+
mountPath: /arguments # <7>

docs/modules/ROOT/pages/usage.adoc

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ include::example$example-sparkapp-configmap.yaml[]
114114
<1> Name of the configuration map
115115
<2> Argument required by the job
116116
<3> Job scala artifact that requires an input argument
117-
<4> The expected job argument, accessed via the mounted configuration map file
118-
<5> The name of the configuration map that will be mounted to the driver/executor
119-
<6> The mount location of the configuration map (this will contain a file `/arguments/job-args.txt`)
117+
<4> The volume backed by the configuration map
118+
<5> The expected job argument, accessed via the mounted configuration map file
119+
<6> The name of the volume backed by the configuration map that will be mounted to the driver/executor
120+
<7> The mount location of the volume (this will contain a file `/arguments/job-args.txt`)
120121

121122
== CRD argument coverage
122123

@@ -203,12 +204,6 @@ Below are listed the CRD fields that can be defined by the user:
203204
|`spec.driver.volumeMounts.mountPath`
204205
|Volume mount path
205206

206-
|`spec.driver.configMapMounts.configMapName`
207-
|Name of configuration map to be mounted in the driver
208-
209-
|`spec.driver.configMapMounts.path`
210-
|Mount path of the configuration map in the driver
211-
212207
|`spec.executor.cores`
213208
|Number of cores for each executor
214209

@@ -226,11 +221,5 @@ Below are listed the CRD fields that can be defined by the user:
226221

227222
|`spec.executor.volumeMounts.mountPath`
228223
|Volume mount path
229-
230-
|`spec.executor.configMapMounts.configMapName`
231-
|Name of configuration map to be mounted in the executor
232-
233-
|`spec.executor.configMapMounts.path`
234-
|Mount path of the configuration map in the executor
235224
|===
236225

examples/ny-tlc-report-configmap.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ spec:
2222
- name: job-deps
2323
persistentVolumeClaim:
2424
claimName: pvc-ksv
25+
- name: cm-job-arguments
26+
configMap:
27+
name: cm-job-arguments
2528
args:
2629
- "--input /arguments/job-args.txt"
2730
sparkConf:
@@ -35,7 +38,6 @@ spec:
3538
volumeMounts:
3639
- name: job-deps
3740
mountPath: /dependencies
38-
configMapMounts:
3941
- name: cm-job-arguments
4042
mountPath: /arguments
4143
executor:
@@ -45,6 +47,5 @@ spec:
4547
volumeMounts:
4648
- name: job-deps
4749
mountPath: /dependencies
48-
configMapMounts:
4950
- name: cm-job-arguments
5051
mountPath: /arguments

rust/crd/src/lib.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -169,26 +169,6 @@ impl SparkApplication {
169169
tmp.iter().flat_map(|v| v.iter()).cloned().collect()
170170
}
171171

172-
pub fn executor_config_map_mounts(&self) -> Vec<VolumeMount> {
173-
let tmp = self
174-
.spec
175-
.executor
176-
.as_ref()
177-
.and_then(|executor_conf| executor_conf.config_map_mounts.clone());
178-
179-
tmp.iter().flat_map(|v| v.iter()).cloned().collect()
180-
}
181-
182-
pub fn driver_config_map_mounts(&self) -> Vec<VolumeMount> {
183-
let tmp = self
184-
.spec
185-
.driver
186-
.as_ref()
187-
.and_then(|driver_conf| driver_conf.config_map_mounts.clone());
188-
189-
tmp.iter().flat_map(|v| v.iter()).cloned().collect()
190-
}
191-
192172
pub fn executor_volume_mounts(&self) -> Vec<VolumeMount> {
193173
let tmp = self
194174
.spec
@@ -315,8 +295,6 @@ pub struct DriverConfig {
315295
pub memory: Option<String>,
316296
#[serde(default, skip_serializing_if = "Option::is_none")]
317297
pub volume_mounts: Option<Vec<VolumeMount>>,
318-
#[serde(default, skip_serializing_if = "Option::is_none")]
319-
pub config_map_mounts: Option<Vec<VolumeMount>>,
320298
}
321299

322300
impl DriverConfig {
@@ -345,8 +323,6 @@ pub struct ExecutorConfig {
345323
pub memory: Option<String>,
346324
#[serde(default, skip_serializing_if = "Option::is_none")]
347325
pub volume_mounts: Option<Vec<VolumeMount>>,
348-
#[serde(default, skip_serializing_if = "Option::is_none")]
349-
pub config_map_mounts: Option<Vec<VolumeMount>>,
350326
}
351327

352328
impl ExecutorConfig {

0 commit comments

Comments
 (0)