-
Notifications
You must be signed in to change notification settings - Fork 9
/
spark-rstudio.yaml.template
186 lines (186 loc) · 4.39 KB
/
spark-rstudio.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
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: spark-ui-proxy-controller
spec:
serviceName: spark-ui-proxy
replicas: 1
selector:
matchLabels:
component: spark-ui-proxy
template:
metadata:
labels:
component: spark-ui-proxy
spec:
containers:
- name: spark-ui-proxy
image: angelsevillacamins/docker-spark-ui:latest
ports:
- containerPort: 80
resources:
requests:
cpu: 100m
args:
- spark-master:8081
---
kind: Service
apiVersion: v1
metadata:
name: spark-ui-proxy
spec:
ports:
- port: 8080
targetPort: 80
selector:
component: spark-ui-proxy
externalIPs:
- <IP-nuc01>
---
apiVersion: v1
kind: Service
metadata:
name: spark-master
labels:
name: spark-master
spec:
ports:
- name: zeppelin
port: 8181
targetPort: 8181
- name: webui
port: 8081
targetPort: 8080
- name: spark
port: 7077
targetPort: 7077
- name: rstudio
port: 8787
targetPort: 8787
selector:
name: spark-master
externalIPs:
- <IP-nuc01>
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: spark-master
spec:
serviceName: spark-master
replicas: 1
selector:
matchLabels:
name: spark-master
template:
metadata:
labels:
name: spark-master
spec:
containers:
- name : spark-master
image: angelsevillacamins/kubernetes-spark-libraries-rstudio:latest
imagePullPolicy: "Always"
name: spark-master
env:
- name: RSTUDIOUSER
valueFrom:
secretKeyRef:
name: rstudio-user
key: user
- name: RSTUDIOPASSWORD
valueFrom:
secretKeyRef:
name: rstudio-password
key: password
- name: ZEPPELINUSER
valueFrom:
secretKeyRef:
name: zeppelin-user
key: user
- name: ZEPPELINPASSWORD
valueFrom:
secretKeyRef:
name: zeppelin-password
key: password
- name: SPARK_CORES_MAX
value: "${SPARK_CORES_MAX}"
- name: SPARK_EXECUTOR_CORES
value: "${SPARK_EXECUTOR_CORES}"
- name: SPARK_EXECUTOR_MEMORY
value: "${SPARK_EXECUTOR_MEMORY}"
- name: SPARK_DRIVER_CORES
value: "${SPARK_DRIVER_CORES}"
- name: SPARK_DRIVER_MEMORY
value: "${SPARK_DRIVER_MEMORY}"
- name: SPARK_DRIVER_MAXRESULTSIZE
value: "${SPARK_DRIVER_MAXRESULTSIZE}"
volumeMounts:
- name: persist
mountPath: /persist
ports:
- containerPort: 8181
protocol: TCP
- containerPort: 7077
protocol: TCP
- containerPort: 8787
protocol: TCP
resources :
requests :
cpu : ${SPARK_MASTER_REQUESTS_CPU}
memory : "${SPARK_MASTER_REQUESTS_MEMORY}"
limits :
cpu : ${SPARK_MASTER_LIMITS_CPU}
memory : "${SPARK_MASTER_LIMITS_MEMORY}"
volumes:
- name: persist
persistentVolumeClaim:
claimName: persist-pvc
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: spark-worker
spec:
serviceName: spark-worker
replicas: 1
selector:
matchLabels:
name: spark-worker
template:
metadata:
labels:
name: spark-worker
spec:
containers:
- image: angelsevillacamins/kubernetes-spark-libraries:latest
imagePullPolicy: "Always"
name: spark-worker
env:
- name: SPARK_WORKER_REQUESTS_CPU
value: "${SPARK_WORKER_REQUESTS_CPU}"
- name: SPARK_WORKER_REQUESTS_MEMORY
value: "${SPARK_WORKER_REQUESTS_MEMORY}"
volumeMounts:
- name: persist
mountPath: /persist
ports:
- containerPort: 7078
protocol: TCP
resources :
requests :
cpu : ${SPARK_WORKER_REQUESTS_CPU}
memory : "${SPARK_WORKER_REQUESTS_MEMORY}"
limits :
cpu : ${SPARK_WORKER_LIMITS_CPU}
memory : "${SPARK_WORKER_LIMITS_MEMORY}"
command:
- "/bin/bash"
- "-c"
- "--"
args :
- '. ./start-worker.sh; sleep infinity'
volumes:
- name: persist
persistentVolumeClaim:
claimName: persist-pvc