-
Notifications
You must be signed in to change notification settings - Fork 3
/
spark-cluster-group.yaml.template
195 lines (195 loc) · 4.97 KB
/
spark-cluster-group.yaml.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: spark-master
spec:
replicas: 1
selector:
matchLabels:
component: spark-master
template:
metadata:
labels:
component: spark-master
spec:
priorityClassName: normal
hostname: spark-master
containers:
- name: spark-master
image: ucsdets/spark-notebook@sha256:fcc133c9860db1ee14e183305f41f053e1be80537a8d8ecb7debd9de58e247f3
# image: scnakandala/dsc102-pa2-spark:latest
imagePullPolicy: IfNotPresent
env:
- name: JUPYTER_TOKEN
value: $JUPYTER_TOKEN
- name: HOME
value: /home
# https://stackoverflow.com/questions/42072638/spark-submit-how-to-set-the-user-name
- name: SPARK_USER
value: $K8S_USERNAME
command: ["/spark-master"]
ports:
- containerPort: 7077
- containerPort: 8080
- containerPort: 4040
- containerPort: 20002
- containerPort: 50002
- containerPort: 60002
- containerPort: 60003
- containerPort: 60004
resources:
limits:
memory: "4Gi"
cpu: 2
requests:
memory: "4Gi"
cpu: 2
volumeMounts:
- name: dsc102-pa3-datasets
mountPath: /dsc102-pa3-public
subPath: "dsc102-fa20-public"
readOnly: true
- name: home
mountPath: /home
- name: teams
mountPath: /teams
- name: teams
mountPath: /home/teams
volumes:
- name: dsc102-pa3-datasets
persistentVolumeClaim:
claimName: dsmlp-datasets-nfs
- name: home
persistentVolumeClaim:
claimName: home-nfs
- name: teams
persistentVolumeClaim:
claimName: teams
securityContext:
runAsUser: $K8S_UID
fsGroup: $K8S_GID
---
kind: Service
apiVersion: v1
metadata:
name: spark-master
spec:
ports:
- name: webui
port: 8080
targetPort: 8080
- name: spark
port: 7077
targetPort: 7077
- name: sparkui
port: 4040
targetPort: 4040
- name: driverport
port: 20002
targetPort: 20002
- name: blockmgrport
port: 50002
targetPort: 50002
- name: fileserverport
port: 60002
targetPort: 60002
- name: broadcastport
port: 60003
targetPort: 60003
- name: replicaport
port: 60004
targetPort: 60004
selector:
component: spark-master
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: spark-worker
spec:
replicas: $NUM_WORKERS
selector:
matchLabels:
component: spark-worker
template:
metadata:
labels:
component: spark-worker
spec:
containers:
- name: spark-worker
image: ucsdets/spark-notebook@sha256:fcc133c9860db1ee14e183305f41f053e1be80537a8d8ecb7debd9de58e247f3
# image: scnakandala/dsc102-pa2-spark:latest
imagePullPolicy: IfNotPresent
command: ["/spark-worker"]
env:
# https://stackoverflow.com/questions/42072638/spark-submit-how-to-set-the-user-name
- name: SPARK_USER
value: $K8S_USERNAME
ports:
- containerPort: 8081
- containerPort: 30002
- containerPort: 40002
- containerPort: 50002
- containerPort: 60002
- containerPort: 60003
- containerPort: 60004
resources:
limits:
memory: "20Gi"
cpu: 2
requests:
memory: "20Gi"
cpu: 2
volumeMounts:
- name: dsc102-pa3-datasets
mountPath: /dsc102-pa3-public
subPath: "dsc102-fa20-public"
readOnly: true
- name: home
mountPath: /home
- name: teams
mountPath: /teams
volumes:
- name: dsc102-pa3-datasets
persistentVolumeClaim:
claimName: dsmlp-datasets-nfs
- name: home
persistentVolumeClaim:
claimName: home-nfs
- name: teams
persistentVolumeClaim:
claimName: teams
securityContext:
runAsUser: $K8S_UID
fsGroup: $K8S_GID
---
kind: Service
apiVersion: v1
metadata:
name: spark-worker
spec:
ports:
- name: webui
port: 8081
targetPort: 8081
- name: workerport
port: 30002
targetPort: 30002
- name: executorport
port: 40002
targetPort: 40002
- name: blockmgr
port: 50002
targetPort: 50002
- name: fileserverport
port: 60002
targetPort: 60002
- name: broadcastport
port: 60003
targetPort: 60003
- name: replicaport
port: 60004
targetPort: 60004
selector:
component: spark-worker