forked from redhat-openstack/openshift-on-openstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaster.yaml
336 lines (282 loc) · 7.74 KB
/
master.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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
heat_template_version: 2014-10-16
description: >
OpenShift Master
parameters:
key_name:
type: string
constraints:
- custom_constraint: nova.keypair
image:
type: string
constraints:
- custom_constraint: glance.image
flavor:
type: string
constraints:
- custom_constraint: nova.flavor
dns_ip:
type: string
description: IP address of the DNS server
docker_volume_size:
type: number
description: >
size of a cinder volume in GB to allocate to docker for container/image
storage
default: 25
rhn_username:
type: string
rhn_password:
type: string
hidden: true
rhn_pool:
type: string
hidden: true
deployment_type:
type: string
hostname_prefix:
type: string
domain_name:
type: string
ansible_public_key:
type: string
ansible_private_key:
type: string
node_hostnames:
type: string
default: ''
ssh_user:
type: string
timeout:
description: Time to wait until the master setup is ready.
type: number
default: 10800
external_network:
type: string
constraints:
- custom_constraint: neutron.network
infra_node:
type: string
default: ''
infra_node_add:
type: string
default: ''
fixed_network:
type: string
constraints:
- custom_constraint: neutron.network
fixed_subnet:
type: string
constraints:
- custom_constraint: neutron.subnet
lb_hostname:
type: string
default: ''
ldap_url:
type: string
default: ''
ldap_preferred_username:
type: string
default: 'uid'
ldap_bind_dn:
type: string
default: ''
ldap_bind_password:
type: string
default: ''
ldap_ca:
type: string
default: ''
ldap_insecure:
type: string
default: false
openshift_sdn:
type: string
deploy_registry:
type: boolean
deploy_router:
type: boolean
master_server_group:
type: string
master_security_group:
type: string
resources:
port:
type: OS::Neutron::Port
properties:
security_groups:
- {get_param: master_security_group}
network: {get_param: fixed_network}
fixed_ips:
- subnet: {get_param: fixed_subnet}
replacement_policy: AUTO
random_hostname_suffix:
type: OS::Heat::RandomString
properties:
character_classes: [{"class": lowercase}, {"class": digits}]
length: 8
host:
type: OS::Nova::Server
properties:
name:
str_replace:
template: "HOST-SUFFIX.DOMAIN"
params:
HOST: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
DOMAIN: {get_param: domain_name}
admin_user: {get_param: ssh_user}
image: {get_param: image}
flavor: {get_param: flavor}
key_name: {get_param: key_name}
networks:
- port: {get_resource: port}
user_data_format: SOFTWARE_CONFIG
user_data: {get_resource: init}
scheduler_hints:
group: {get_param: master_server_group}
docker_volume:
type: OS::Cinder::Volume
properties:
size: {get_param: docker_volume_size}
docker_volume_attach:
type: OS::Cinder::VolumeAttachment
properties:
instance_uuid: {get_resource: host}
volume_id: {get_resource: docker_volume}
floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: {get_param: external_network}
port_id: {get_resource: port}
init:
type: OS::Heat::MultipartMime
properties:
parts:
- config: {get_resource: set_hostname}
- config: {get_resource: included_files}
- config: {get_resource: rhn_register}
- config: {get_resource: host_update}
- config: {get_resource: master_boot}
set_hostname:
type: OS::Heat::CloudConfig
properties:
cloud_config:
hostname:
str_replace:
template: "HOST-SUFFIX"
params:
HOST: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
fqdn:
str_replace:
template: "HOST-SUFFIX.DOMAIN"
params:
HOST: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
DOMAIN: {get_param: domain_name}
included_files:
type: OS::Heat::CloudConfig
properties:
cloud_config:
write_files:
- path: /etc/hosts
content:
str_replace:
params:
$NODE_IP: {get_attr: [floating_ip, floating_ip_address]}
$NODE_HOSTNAME:
str_replace:
template: "HOST-SUFFIX"
params:
HOST: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
$NODE_DOMAIN: {get_param: domain_name}
template: {get_file: fragments/etc-node-hosts}
- path: /root/.ssh/id_rsa
permissions: 0600
content: {get_param: ansible_private_key}
- path: /root/.ssh/id_rsa.pub
permissions: 0600
content: {get_param: ansible_public_key}
- path: /usr/local/bin/retry
permissions: 0755
content: {get_file: fragments/retry.sh}
ssh_authorized_keys:
- {get_param: ansible_public_key}
rhn_register:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
params:
$RHN_USERNAME: {get_param: rhn_username}
$RHN_PASSWORD: {get_param: rhn_password}
$POOL_ID: {get_param: rhn_pool}
template: {get_file: fragments/rhn-register.sh}
host_update:
type: OS::Heat::SoftwareConfig
properties:
config:
get_file: fragments/host-update.sh
master_boot:
type: OS::Heat::SoftwareConfig
properties:
group: script
config:
str_replace:
params:
$DNS_IP: {get_param: dns_ip}
$MASTER_IP: {get_attr: [floating_ip, floating_ip_address]}
$WC_NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
template: {get_file: fragments/master-boot.sh}
deployment_infra_node_add:
type: OS::Heat::SoftwareDeployment
properties:
config:
get_param: infra_node_add
server:
get_param: infra_node
input_values:
node_etc_host:
str_replace:
template: "IP HOST-SUFFIX.DOMAIN HOST-SUFFIX #openshift"
params:
IP: {get_attr: [floating_ip, floating_ip_address]}
HOST: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
DOMAIN: {get_param: domain_name}
wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: {get_resource: wait_handle}
timeout: {get_param: timeout}
wait_handle:
type: OS::Heat::WaitConditionHandle
outputs:
console_url:
value:
str_replace:
params:
HOSTNAME: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
DOMAINNAME: {get_param: domain_name}
template: "https://HOSTNAME-SUFFIX.DOMAINNAME:8443/console/"
api_url:
value:
str_replace:
params:
HOSTNAME: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
DOMAINNAME: {get_param: domain_name}
template: "https://HOSTNAME-SUFFIX.DOMAINNAME:8443/"
wc_data:
value: { get_attr: ['wait_condition', 'data'] }
hostname:
value:
str_replace:
template: "HOST-SUFFIX"
params:
HOST: {get_param: hostname_prefix}
SUFFIX: {get_attr: [random_hostname_suffix, value]}
host:
value: {get_resource: host}