Debian Codegraph @

contrib/drivers/k8s_opensuse_v1/templates/kubecluster.yaml

raw symbols SCIP
1 heat_template_version: 2014-10-16
2
3 description: >
4 This template will boot a Kubernetes cluster with one or more
5 minions (as specified by the number_of_minions parameter, which
6 defaults to 1).
7
8 parameters:
9
10 ssh_key_name:
11 type: string
12 description: name of ssh key to be provisioned on our server
13
14 external_network:
15 type: string
16 description: uuid/name of a network to use for floating ip addresses
17 default: public
18
19 server_image:
20 type: string
21 description: glance image used to boot the server
22
23 master_flavor:
24 type: string
25 default: m1.small
26 description: flavor to use when booting the server for master nodes
27
28 minion_flavor:
29 type: string
30 default: m1.small
31 description: flavor to use when booting the server for minions
32
33 dns_nameserver:
34 type: comma_delimited_list
35 description: address of a DNS nameserver reachable in your environment
36 default: 8.8.8.8
37
38 number_of_masters:
39 type: number
40 description: how many kubernetes masters to spawn
41 default: 1
42
43 number_of_minions:
44 type: number
45 description: how many kubernetes minions to spawn
46 default: 1
47
48 fixed_subnet_cidr:
49 type: string
50 description: network range for fixed ip network
51 default: 10.0.0.0/24
52
53 portal_network_cidr:
54 type: string
55 description: >
56 address range used by kubernetes for service portals
57 default: 10.254.0.0/16
58
59 network_driver:
60 type: string
61 description: network driver to use for instantiating container networks
62 default: flannel
63
64 flannel_network_cidr:
65 type: string
66 description: network range for flannel overlay network
67 default: 10.100.0.0/16
68
69 flannel_network_subnetlen:
70 type: number
71 description: size of subnet assigned to each minion
72 default: 24
73
74 flannel_network_subnet_min:
75 type: string
76 description: minimum subnet
77 default: 10.100.50.0
78
79 flannel_network_subnet_max:
80 type: string
81 description: maximum subnet
82 default: 10.100.199.0
83
84 flannel_backend:
85 type: string
86 description: >
87 specify the backend for flannel, default udp backend
88 default: "udp"
89 constraints:
90 - allowed_values: ["udp", "vxlan", "host-gw"]
91
92 system_pods_initial_delay:
93 type: number
94 description: >
95 health check, time to wait for system pods (podmaster, scheduler) to boot
96 (in seconds)
97 default: 30
98
99 system_pods_timeout:
100 type: number
101 description: >
102 health check, timeout for system pods (podmaster, scheduler) to answer.
103 (in seconds)
104 default: 5
105
106 kube_allow_priv:
107 type: string
108 description: >
109 whether or not kubernetes should permit privileged containers.
110 default: "true"
111 constraints:
112 - allowed_values: ["true", "false"]
113
114 docker_volume_size:
115 type: number
116 description: >
117 size of a cinder volume to allocate to docker for container/image
118 storage
119 default: 0
120
121 wait_condition_timeout:
122 type: number
123 description: >
124 timeout for the Wait Conditions
125 default: 2400
126
127 minions_to_remove:
128 type: comma_delimited_list
129 description: >
130 List of minions to be removed when doing an update. Individual minion may
131 be referenced several ways: (1) The resource name (e.g. ['1', '3']),
132 (2) The private IP address ['10.0.0.4', '10.0.0.6']. Note: the list should
133 be empty when doing an create.
134 default: []
135
136 discovery_url:
137 type: string
138 description: >
139 Discovery URL used for bootstrapping the etcd cluster.
140
141 registry_enabled:
142 type: boolean
143 description: >
144 Indicates whether the docker registry is enabled.
145 default: false
146
147 registry_port:
148 type: number
149 description: port of registry service
150 default: 5000
151
152 registry_username:
153 type: string
154 description: username used by docker registry
155 default: "username"
156
157 registry_password:
158 type: string
159 description: password used by docker registry
160 default: "password"
161 hidden: true
162
163 registry_domain:
164 type: string
165 description: domain used by docker registry
166 default: "domain"
167
168 registry_trust_id:
169 type: string
170 description: trust_id used by docker registry
171 default: "trust_id"
172 hidden: true
173
174 registry_auth_url:
175 type: string
176 description: auth_url for keystone
177 default: "auth_url"
178
179 registry_region:
180 type: string
181 description: region of swift service
182 default: "region"
183
184 registry_container:
185 type: string
186 description: >
187 name of swift container which docker registry stores images in
188 default: "container"
189
190 registry_insecure:
191 type: boolean
192 description: >
193 indicates whether to skip TLS verification between registry and backend storage
194 default: true
195
196 registry_chunksize:
197 type: number
198 description: >
199 size fo the data segments for the swift dynamic large objects
200 default: 5242880
201
202 auth_url:
203 type: string
204 description: >
205 url for kubernetes to authenticate before sending request to neutron
206 must be v2 since kubernetes backend only suppor v2 at this point
207
208 kube_version:
209 type: string
210 description: version of kubernetes used for kubernetes cluster
211 default: v1.3.7
212
213 volume_driver:
214 type: string
215 description: volume driver to use for container storage
216 default: ""
217
218 username:
219 type: string
220 description: >
221 user account
222
223 password:
224 type: string
225 description: >
226 user password, not set in current implementation, only used to
227 fill in for Kubernetes config file
228 default:
229 ChangeMe
230 hidden: true
231
232 tenant_name:
233 type: string
234 description: >
235 tenant name
236
237 loadbalancing_protocol:
238 type: string
239 description: >
240 The protocol which is used for load balancing. If you want to change
241 tls_disabled option to 'True', please change this to "HTTP".
242 default: TCP
243 constraints:
244 - allowed_values: ["TCP", "HTTP"]
245
246 tls_disabled:
247 type: boolean
248 description: whether or not to disable TLS
249 default: False
250
251 kubernetes_port:
252 type: number
253 description: >
254 The port which are used by kube-apiserver to provide Kubernetes
255 service.
256 default: 6443
257
258 cluster_uuid:
259 type: string
260 description: identifier for the cluster this template is generating
261
262 magnum_url:
263 type: string
264 description: endpoint to retrieve TLS certs from
265
266 http_proxy:
267 type: string
268 description: http proxy address for docker
269 default: ""
270
271 https_proxy:
272 type: string
273 description: https proxy address for docker
274 default: ""
275
276 no_proxy:
277 type: string
278 description: no proxies for docker
279 default: ""
280
281 trustee_domain_id:
282 type: string
283 description: domain id of the trustee
284 default: ""
285
286 trustee_user_id:
287 type: string
288 description: user id of the trustee
289 default: ""
290
291 trustee_username:
292 type: string
293 description: username of the trustee
294 default: ""
295
296 trustee_password:
297 type: string
298 description: password of the trustee
299 default: ""
300 hidden: true
301
302 trust_id:
303 type: string
304 description: id of the trust which is used by the trustee
305 default: ""
306 hidden: true
307
308 domain_name:
309 type: string
310 description: domain_name
311 default: ""
312
313 resources:
314
315 ######################################################################
316 #
317 # network resources. allocate a network and router for our server.
318 # Important: the Load Balancer feature in Kubernetes requires that
319 # the name for the fixed_network must be "private" for the
320 # address lookup in Kubernetes to work properly
321 #
322
323 fixed_network:
324 type: OS::Neutron::Net
325 properties:
326 name: private
327
328 fixed_subnet:
329 type: OS::Neutron::Subnet
330 properties:
331 cidr: {get_param: fixed_subnet_cidr}
332 network: {get_resource: fixed_network}
333 dns_nameservers:
334 - {get_param: dns_nameserver}
335
336 extrouter:
337 type: OS::Neutron::Router
338 properties:
339 external_gateway_info:
340 network: {get_param: external_network}
341
342 extrouter_inside:
343 type: OS::Neutron::RouterInterface
344 properties:
345 router_id: {get_resource: extrouter}
346 subnet: {get_resource: fixed_subnet}
347
348 ######################################################################
349 #
350 # security groups. we need to permit network traffic of various
351 # sorts.
352 #
353
354 secgroup_base:
355 type: OS::Neutron::SecurityGroup
356 properties:
357 rules:
358 - protocol: icmp
359 - protocol: tcp
360 port_range_min: 22
361 port_range_max: 22
362
363 secgroup_kube_master:
364 type: OS::Neutron::SecurityGroup
365 properties:
366 rules:
367 - protocol: tcp
368 port_range_min: 7080
369 port_range_max: 7080
370 - protocol: tcp
371 port_range_min: 8080
372 port_range_max: 8080
373 - protocol: tcp
374 port_range_min: 2379
375 port_range_max: 2379
376 - protocol: tcp
377 port_range_min: 2380
378 port_range_max: 2380
379 - protocol: tcp
380 port_range_min: 6443
381 port_range_max: 6443
382 - protocol: tcp
383 port_range_min: 10250
384 port_range_max: 10250
385 - protocol: tcp
386 port_range_min: 30000
387 port_range_max: 32767
388 - protocol: udp
389 port_range_min: 8285
390 port_range_max: 8285
391 - protocol: udp
392 port_range_min: 8472
393 port_range_max: 8472
394
395 secgroup_kube_minion:
396 type: OS::Neutron::SecurityGroup
397 properties:
398 rules:
399 - protocol: icmp
400 - protocol: tcp
401 - protocol: udp
402
403 ######################################################################
404 #
405 # load balancers.
406 #
407
408 api_loadbalancer:
409 type: Magnum::Optional::Neutron::LBaaS::LoadBalancer
410 properties:
411 vip_subnet: {get_resource: fixed_subnet}
412
413 api_listener:
414 type: Magnum::Optional::Neutron::LBaaS::Listener
415 properties:
416 loadbalancer: {get_resource: api_loadbalancer}
417 protocol: {get_param: loadbalancing_protocol}
418 protocol_port: {get_param: kubernetes_port}
419
420 api_pool:
421 type: Magnum::Optional::Neutron::LBaaS::Pool
422 properties:
423 lb_algorithm: ROUND_ROBIN
424 listener: {get_resource: api_listener}
425 protocol: {get_param: loadbalancing_protocol}
426
427 api_monitor:
428 type: Magnum::Optional::Neutron::LBaaS::HealthMonitor
429 properties:
430 type: TCP
431 delay: 5
432 max_retries: 5
433 timeout: 5
434 pool: { get_resource: api_pool }
435
436 api_pool_floating:
437 type: Magnum::Optional::Neutron::FloatingIP
438 depends_on:
439 - extrouter_inside
440 properties:
441 floating_network: {get_param: external_network}
442 port_id: {get_attr: [api_loadbalancer, vip_port_id]}
443
444 etcd_loadbalancer:
445 type: Magnum::Optional::Neutron::LBaaS::LoadBalancer
446 properties:
447 vip_subnet: {get_resource: fixed_subnet}
448
449 etcd_listener:
450 type: Magnum::Optional::Neutron::LBaaS::Listener
451 properties:
452 loadbalancer: {get_resource: etcd_loadbalancer}
453 protocol: HTTP
454 protocol_port: 2379
455
456 etcd_pool:
457 type: Magnum::Optional::Neutron::LBaaS::Pool
458 properties:
459 lb_algorithm: ROUND_ROBIN
460 listener: {get_resource: etcd_listener}
461 protocol: HTTP
462
463 etcd_monitor:
464 type: Magnum::Optional::Neutron::LBaaS::HealthMonitor
465 properties:
466 type: TCP
467 delay: 5
468 max_retries: 5
469 timeout: 5
470 pool: { get_resource: etcd_pool }
471
472 ######################################################################
473 #
474 # resources that expose the IPs of either the kube master or a given
475 # LBaaS pool depending on whether LBaaS is enabled for the cluster.
476 #
477
478 api_address_lb_switch:
479 type: Magnum::ApiGatewaySwitcher
480 properties:
481 pool_public_ip: {get_attr: [api_pool_floating, floating_ip_address]}
482 pool_private_ip: {get_attr: [api_loadbalancer, vip_address]}
483 master_public_ip: {get_attr: [kube_masters, resource.0.kube_master_external_ip]}
484 master_private_ip: {get_attr: [kube_masters, resource.0.kube_master_ip]}
485
486 etcd_address_lb_switch:
487 type: Magnum::ApiGatewaySwitcher
488 properties:
489 pool_private_ip: {get_attr: [etcd_loadbalancer, vip_address]}
490 master_private_ip: {get_attr: [kube_masters, resource.0.kube_master_ip]}
491
492 ######################################################################
493 #
494 # resources that expose the IPs of either floating ip or a given
495 # fixed ip depending on whether FloatingIP is enabled for the cluster.
496 #
497
498 api_address_floating_switch:
499 type: Magnum::FloatingIPAddressSwitcher
500 properties:
501 public_ip: {get_attr: [api_address_lb_switch, public_ip]}
502 private_ip: {get_attr: [api_address_lb_switch, private_ip]}
503
504 ######################################################################
505 #
506 # kubernetes masters. This is a resource group that will create
507 # <number_of_masters> masters.
508 #
509
510 kube_masters:
511 type: OS::Heat::ResourceGroup
512 depends_on:
513 - extrouter_inside
514 properties:
515 count: {get_param: number_of_masters}
516 resource_def:
517 type: kubemaster.yaml
518 properties:
519 api_public_address: {get_attr: [api_pool_floating, floating_ip_address]}
520 api_private_address: {get_attr: [api_loadbalancer, vip_address]}
521 ssh_key_name: {get_param: ssh_key_name}
522 server_image: {get_param: server_image}
523 master_flavor: {get_param: master_flavor}
524 external_network: {get_param: external_network}
525 kube_allow_priv: {get_param: kube_allow_priv}
526 wait_condition_timeout: {get_param: wait_condition_timeout}
527 network_driver: {get_param: network_driver}
528 flannel_backend: {get_param: flannel_backend}
529 flannel_network_cidr: {get_param: flannel_network_cidr}
530 flannel_network_subnetlen: {get_param: flannel_network_subnetlen}
531 flannel_network_subnet_min: {get_param: flannel_network_subnet_min}
532 flannel_network_subnet_max: {get_param: flannel_network_subnet_max}
533 system_pods_initial_delay: {get_param: system_pods_initial_delay}
534 system_pods_timeout: {get_param: system_pods_timeout}
535 portal_network_cidr: {get_param: portal_network_cidr}
536 discovery_url: {get_param: discovery_url}
537 cluster_uuid: {get_param: cluster_uuid}
538 magnum_url: {get_param: magnum_url}
539 http_proxy: {get_param: http_proxy}
540 https_proxy: {get_param: https_proxy}
541 no_proxy: {get_param: no_proxy}
542 kube_version: {get_param: kube_version}
543 fixed_network: {get_resource: fixed_network}
544 fixed_subnet: {get_resource: fixed_subnet}
545 api_pool_id: {get_resource: api_pool}
546 etcd_pool_id: {get_resource: etcd_pool}
547 auth_url: {get_param: auth_url}
548 username: {get_param: username}
549 password: {get_param: password}
550 tenant_name: {get_param: tenant_name}
551 kubernetes_port: {get_param: kubernetes_port}
552 tls_disabled: {get_param: tls_disabled}
553 secgroup_base_id: {get_resource: secgroup_base}
554 secgroup_kube_master_id: {get_resource: secgroup_kube_master}
555 kube_master_id: 'kube-master%index%'
556 kube_master_ports: { get_attr: [kube_master_ports, refs] }
557 kube_master_ips: {get_attr: [kube_master_ports, fixed_ip]}
558 kube_master_ips_list: { list_join: ["|", {get_attr: [kube_master_ports, fixed_ip]} ] }
559 kube_minion_ips_list: { list_join: ["|", {get_attr: [kube_minion_ports, fixed_ip]} ] }
560 trustee_user_id: {get_param: trustee_user_id}
561 trustee_password: {get_param: trustee_password}
562 trust_id: {get_param: trust_id}
563 domain_name: {get_param: domain_name}
564
565 ######################################################################
566 #
567 # kubernetes minions. This is an resource group that will initially
568 # create <number_of_minions> minions, and needs to be manually scaled.
569 #
570
571 kube_minions:
572 type: OS::Heat::ResourceGroup
573 depends_on:
574 - extrouter_inside
575 - kube_masters
576 properties:
577 count: {get_param: number_of_minions}
578 removal_policies: [{resource_list: {get_param: minions_to_remove}}]
579 resource_def:
580 type: kubeminion.yaml
581 properties:
582 ssh_key_name: {get_param: ssh_key_name}
583 server_image: {get_param: server_image}
584 minion_flavor: {get_param: minion_flavor}
585 fixed_network: {get_resource: fixed_network}
586 fixed_subnet: {get_resource: fixed_subnet}
587 network_driver: {get_param: network_driver}
588 flannel_network_cidr: {get_param: flannel_network_cidr}
589 kube_master_ip: {get_attr: [api_address_lb_switch, private_ip]}
590 etcd_server_ip: {get_attr: [etcd_address_lb_switch, private_ip]}
591 external_network: {get_param: external_network}
592 kube_allow_priv: {get_param: kube_allow_priv}
593 docker_volume_size: {get_param: docker_volume_size}
594 wait_condition_timeout: {get_param: wait_condition_timeout}
595 registry_enabled: {get_param: registry_enabled}
596 registry_port: {get_param: registry_port}
597 registry_username: {get_param: registry_username}
598 registry_password: {get_param: registry_password}
599 registry_domain: {get_param: registry_domain}
600 registry_trust_id: {get_param: registry_trust_id}
601 registry_auth_url: {get_param: registry_auth_url}
602 registry_region: {get_param: registry_region}
603 registry_container: {get_param: registry_container}
604 registry_insecure: {get_param: registry_insecure}
605 registry_chunksize: {get_param: registry_chunksize}
606 cluster_uuid: {get_param: cluster_uuid}
607 magnum_url: {get_param: magnum_url}
608 http_proxy: {get_param: http_proxy}
609 https_proxy: {get_param: https_proxy}
610 no_proxy: {get_param: no_proxy}
611 kube_version: {get_param: kube_version}
612 kubernetes_port: {get_param: kubernetes_port}
613 tls_disabled: {get_param: tls_disabled}
614 secgroup_kube_minion_id: {get_resource: secgroup_kube_minion}
615 kube_minion_id: 'kube-minion%index%'
616 kube_minion_ports: { get_attr: [kube_minion_ports, refs] }
617 kube_minion_ips: {get_attr: [kube_minion_ports, fixed_ip]}
618 kube_master_ips_list: { list_join: ["|", {get_attr: [kube_master_ports, fixed_ip]} ] }
619 kube_minion_ips_list: { list_join: ["|", {get_attr: [kube_minion_ports, fixed_ip]} ] }
620 auth_url: {get_param: auth_url}
621 trustee_user_id: {get_param: trustee_user_id}
622 trustee_username: {get_param: trustee_username}
623 trustee_password: {get_param: trustee_password}
624 trustee_domain_id: {get_param: trustee_domain_id}
625 trust_id: {get_param: trust_id}
626
627 outputs:
628
629 api_address:
630 value:
631 str_replace:
632 template: api_ip_address
633 params:
634 api_ip_address: {get_attr: [api_address_floating_switch, ip_address]}
635 description: >
636 This is the API endpoint of the Kubernetes cluster. Use this to access
637 the Kubernetes API.
638
639 registry_address:
640 value:
641 str_replace:
642 template: localhost:port
643 params:
644 port: {get_param: registry_port}
645 description:
646 This is the url of docker registry server where you can store docker
647 images.
648
649 kube_masters:
650 value: {get_attr: [kube_masters, kube_master_external_ip]}
651 description: >
652 This is a list of the "public" IP addresses of all the Kubernetes masters.
653 Use these IP addresses to log in to the Kubernetes masters via ssh.
654
655 kube_minions:
656 value: {get_attr: [kube_minions, kube_minion_ip]}
657 description: >
658 This is a list of the "private" IP addresses of all the Kubernetes minions.
659
660 kube_minions_external:
661 value: {get_attr: [kube_minions, kube_minion_external_ip]}
662 description: >
663 This is a list of the "public" IP addresses of all the Kubernetes minions.
664 Use these IP addresses to log in to the Kubernetes minions via ssh.