forked from redhat-openstack/openshift-on-openstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loadbalancer.yaml
208 lines (173 loc) · 4.53 KB
/
loadbalancer.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
heat_template_version: 2014-10-16
description: >
A host providing the loadbalancing for the OpenShift master nodes.
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
hostname:
type: string
domain_name:
type: string
rhn_username:
type: string
rhn_password:
type: string
hidden: true
rhn_pool:
type: string
hidden: true
ssh_user:
type: string
external_network:
type: string
constraints:
- custom_constraint: neutron.network
fixed_network:
type: string
constraints:
- custom_constraint: neutron.network
fixed_subnet:
type: string
constraints:
- custom_constraint: neutron.subnet
ansible_public_key:
type: string
dns_ip:
type: string
description: IP address of the DNS server
timeout:
description: Time to wait until the master setup is ready.
type: number
default: 4000
resources:
floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: {get_param: external_network}
port_id: {get_resource: port}
port:
type: OS::Neutron::Port
properties:
security_groups:
- {get_resource: security_group}
network: {get_param: fixed_network}
fixed_ips:
- subnet: {get_param: fixed_subnet}
replacement_policy: AUTO
security_group:
type: OS::Neutron::SecurityGroup
properties:
rules:
- protocol: icmp
# Just open everything for now:
- protocol: tcp
port_range_min: 0
port_range_max: 65535
- protocol: udp
port_range_min: 0
port_range_max: 65535
host:
type: OS::Nova::Server
properties:
name:
str_replace:
template: "HOST.DOMAIN"
params:
HOST: {get_param: hostname}
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}
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: lb_boot}
set_hostname:
type: OS::Heat::CloudConfig
properties:
cloud_config:
hostname: {get_param: hostname}
fqdn:
str_replace:
template: "HOST.DOMAIN"
params:
HOST: {get_param: hostname}
DOMAIN: {get_param: domain_name}
included_files:
type: OS::Heat::CloudConfig
properties:
cloud_config:
write_files:
- path: /usr/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
lb_boot:
type: OS::Heat::SoftwareConfig
properties:
config:
str_replace:
params:
$DNS_IP: {get_param: dns_ip}
$WC_NOTIFY: { get_attr: ['wait_handle', 'curl_cli'] }
template: {get_file: fragments/lb-boot.sh}
wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: {get_resource: wait_handle}
timeout: {get_param: timeout}
wait_handle:
type: OS::Heat::WaitConditionHandle
outputs:
floating_ip:
value: {get_attr: [floating_ip, floating_ip_address]}
console_url:
value:
str_replace:
params:
HOSTNAME: {get_param: hostname}
DOMAINNAME: {get_param: domain_name}
template: "https://HOSTNAME.DOMAINNAME:8443/console/"
api_url:
value:
str_replace:
params:
HOSTNAME: {get_param: hostname}
DOMAINNAME: {get_param: domain_name}
template: "https://HOSTNAME.DOMAINNAME:8443/"