This repository has been archived by the owner on Jan 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
stack_full.yaml
188 lines (185 loc) · 6.31 KB
/
stack_full.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
heat_template_version: 2017-02-24
description: Deploy Kubernetes cluster with kubeadm
parameters:
key_name:
type: string
label: Key Name
description: SSH key to be used for all instances
image:
type: string
label: Image
description: Image to be used
default: ubuntu-16-04-amd64-cloudimg
master_flavor:
type: string
label: Master Instance Type
description: Type of instance (flavor) to deploy master node
default: m1.small
master_floating_ip:
type: string
label: Master Floating IP ID
description: Floating IP for master node
slave_count:
type: number
label: Slave Count
description: Number of slaves
default: 3
slave_flavor:
type: string
label: Slave Instance Type
description: Type of instance (flavor) to deploy slave nodes
default: m1.small
slave_floating_ips:
type: comma_delimited_list
label: Slave Floating IP IDs
description: Floating IP for master node
public_network_id:
type: string
description: ID of the public network
default: public
resource_prefix:
type: string
description: Prefix to add to all resources
default: k8s-
dns_nameservers:
type: comma_delimited_list
label: DNS Nameservers
description: DNS nameservers to use on nodes
default: 8.8.8.8
availability_zone:
type: string
label: Availability Zone
description: Availabilito zone to create nodes in
proxy_host:
type: string
label: Proxy Host
description: Proxy host to use
default: ""
proxy_port:
type: number
label: Proxy Port
description: Proxy port to use
default: 0
conditions:
deploy_proxy:
equals:
- { get_param: proxy_host }
- "deploy"
resources:
random_string:
type: OS::Heat::RandomString
properties:
length: 8
sequence: lowercase
prefix_random:
type: OS::Heat::Value
properties:
value:
str_replace:
template: $prefix$random
params:
$prefix: { get_param: resource_prefix }
$random: { get_resource: random_string }
##### Network #####
internal_net:
type: OS::Neutron::Net
properties:
admin_state_up: true
name:
str_replace:
template: $prefix-network
params:
$prefix: { get_attr: [prefix_random, value] }
internal_subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: internal_net }
cidr: 10.2.2.0/24
gateway_ip: 10.2.2.1
enable_dhcp: true
dns_nameservers: { get_param: dns_nameservers }
name:
str_replace:
template: $prefix-subnet
params:
$prefix: { get_attr: [prefix_random, value] }
internal_router:
type: OS::Neutron::Router
properties:
admin_state_up: true
external_gateway_info: { "network": { get_param: public_network_id }}
name:
str_replace:
template: $prefix-router
params:
$prefix: { get_attr: [prefix_random, value] }
internal_router_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: internal_router }
subnet_id: { get_resource: internal_subnet }
security_group:
type: OS::Neutron::SecurityGroup
properties:
name:
str_replace:
template: $prefix-security-group
params:
$prefix: { get_attr: [prefix_random, value] }
rules:
- remote_mode: remote_group_id
direction: ingress
- remote_mode: remote_group_id
direction: egress
- direction: egress
- protocol: icmp
- port_range_min: 22
port_range_max: 22
protocol: tcp
- port_range_min: 6443
port_range_max: 6443
protocol: tcp
- port_range_min: 30000
port_range_max: 32767
protocol: tcp
##### Stack #####
stack:
type: stack.yaml
depends_on: internal_subnet
properties:
key_name: { get_param: key_name }
image: { get_param: image }
master_flavor: { get_param: master_flavor }
master_floating_ip: { get_param: master_floating_ip }
slave_count: { get_param: slave_count }
slave_flavor: { get_param: slave_flavor }
slave_floating_ips: { get_param: slave_floating_ips }
public_network_id: { get_param: public_network_id }
internal_net: { get_resource: internal_net }
resource_prefix: { get_attr: [prefix_random, value] }
dns_nameservers: { get_param: dns_nameservers }
availability_zone: { get_param: availability_zone }
security_group: { get_resource: security_group }
proxy_host:
if:
- deploy_proxy
- { get_attr: [proxy_node, ip_address] }
- { get_param: proxy_host }
proxy_port:
if:
- deploy_proxy
- 3128
- { get_param: proxy_port }
proxy_node:
type: proxy.yaml
depends_on: internal_subnet
condition: deploy_proxy
properties:
key_name: { get_param: key_name }
image: { get_param: image }
flavor: { get_param: master_flavor }
public_network_id: { get_param: public_network_id }
internal_net: { get_resource: internal_net }
resource_prefix: { get_attr: [prefix_random, value] }
availability_zone: { get_param: availability_zone }
security_group: { get_resource: security_group }