-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
108 lines (103 loc) · 2.28 KB
/
template.yaml
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
kind: Template
apiVersion: v1
template: spark
metadata:
name: spark
labels:
app: sparkcluster
objects:
- kind: Service
apiVersion: v1
metadata:
name: ${MASTER_NAME}
labels:
name: ${MASTER_NAME}
spec:
ports:
- protocol: TCP
port: 7077
targetPort: 7077
selector:
name: ${MASTER_NAME}
- kind: Service
apiVersion: v1
metadata:
name: ${MASTER_NAME}-webui
labels:
name: ${MASTER_NAME}
spec:
ports:
- protocol: TCP
port: 8080
targetPort: 8080
selector:
name: ${MASTER_NAME}
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: ${MASTER_NAME}
spec:
strategy:
type: Rolling
triggers:
- type: ConfigChange
replicas: 1
selector:
name: ${MASTER_NAME}
template:
metadata:
labels:
name: ${MASTER_NAME}
spec:
containers:
- name: ${MASTER_NAME}
image: ${SPARK_IMAGE}
env:
- name: SPARK_MASTER_PORT
value: "7077"
- name: SPARK_MASTER_WEBUI_PORT
value: "8080"
ports:
- containerPort: 7077
protocol: TCP
- containerPort: 8080
protocol: TCP
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: ${WORKER_NAME}
spec:
strategy:
type: Rolling
triggers:
- type: ConfigChange
replicas: 3
selector:
name: ${WORKER_NAME}
template:
metadata:
labels:
name: ${WORKER_NAME}
spec:
containers:
- name: ${WORKER_NAME}
image: ${SPARK_IMAGE}
env:
- name: SPARK_MASTER_ADDRESS
value: spark://${MASTER_NAME}:7077
- name: SPARK_MASTER_UI_ADDRESS
value: http://${MASTER_NAME}-webui:8080
parameters:
- name: SPARK_IMAGE
description: Name of the Spark master/worker image
value: _REPO_/openshift-spark:latest
- name: MASTER_NAME
description: master name used as a service name and a selector
generate: expression
from: "spark-master-[a-z0-9]{4}"
required: true
- name: WORKER_NAME
description: worker name used as a selector
generate: expression
from: "spark-worker-[a-z0-9]{4}"
required: true