Make ironic templates working

This first fix make ironic template working to boot kubernetes cluster.

Change-Id: Ia54bf9ef647d623b5f832ec1069cd6a037c2b6c1
Partial-Bug: 1454895
changes/96/198596/4
Kai Qiang Wu(Kennan) 8 years ago
parent 8fe06c03e6
commit 52268629c1

@ -14,9 +14,9 @@ parameters:
type: string
description: name of ssh key to be provisioned on our server
external_network_id:
external_network:
type: string
description: uuid of a network to use for floating ip addresses
description: uuid/name of a network to use for floating ip addresses
fixed_network:
type: string
@ -82,110 +82,96 @@ parameters:
be empty when doing an create.
default: []
wait_condition_timeout:
type: number
description : >
timeout for the Wait Conditions
default: 6000
resources:
master_wait_handle:
type: OS::Heat::WaitConditionHandle
master_wait_condition:
type: OS::Heat::WaitCondition
depends_on: kube_master
properties:
handle: {get_resource: master_wait_handle}
timeout: {get_param: wait_condition_timeout}
master_wc_notify:
type: OS::Heat::SoftwareConfig
properties:
group: ungrouped
config:
str_replace:
template: |
#!/bin/bash -v
wc_notify --data-binary '{"status": "SUCCESS"}'
params:
wc_notify: {get_attr: [master_wait_handle, curl_cli]}
######################################################################
#
# software configs and deployments.
# software configs
#
disable_selinux:
type: "OS::Heat::SoftwareConfig"
properties:
group: script
group: ungrouped
config: {get_file: fragments/disable-selinux.sh}
disable_selinux_deployment:
type: OS::Heat::SoftwareDeployment
kube_master_init:
type: OS::Heat::MultipartMime
properties:
config:
get_resource: disable_selinux
server:
get_resource: kube_master
parts:
- config: {get_resource: disable_selinux}
- config: {get_resource: write_heat_params}
- config: {get_resource: enable_etcd}
- config: {get_resource: configure_kubernetes}
- config: {get_resource: enable_services}
- config: {get_resource: configure_flannel}
- config: {get_resource: master_wc_notify}
write_heat_params:
type: "OS::Heat::SoftwareConfig"
properties:
group: script
group: ungrouped
config:
str_replace:
template: {get_file: fragments/write-heat-params-master.sh}
template: {get_file: fragments/write-heat-params-master.yaml}
params:
"$MINION_ADDRESSES": {"Fn::Join": [",", {get_attr: [kube_minions, kube_node_ip]}]}
"$KUBE_ALLOW_PRIV": {get_param: kube_allow_priv}
"$FLANNEL_NETWORK_CIDR": {get_param: flannel_network_cidr}
"$FLANNEL_NETWORK_SUBNETLEN": {get_param: flannel_network_subnetlen}
"$FLANNEL_USE_VXLAN": {get_param: flannel_use_vxlan}
"$PORTAL_NETWORK_CIDR": {get_param: portal_network_cidr}
write_heat_params_deployment:
type: OS::Heat::SoftwareDeployment
depends_on: disable_selinux_deployment
properties:
config:
get_resource: write_heat_params
server:
get_resource: kube_master
configure_kubernetes:
type: "OS::Heat::SoftwareConfig"
properties:
group: script
group: ungrouped
config: {get_file: fragments/configure-kubernetes-master.sh}
configure_kubernetes_deployment:
type: OS::Heat::SoftwareDeployment
depends_on: write_heat_params_deployment
properties:
config:
get_resource: configure_kubernetes
server:
get_resource: kube_master
enable_etcd:
type: "OS::Heat::SoftwareConfig"
properties:
group: script
group: ungrouped
config: {get_file: fragments/enable-etcd.sh}
enable_etcd_deployment:
type: OS::Heat::SoftwareDeployment
depends_on: configure_kubernetes_deployment
properties:
config:
get_resource: enable_etcd
server:
get_resource: kube_master
configure_flannel:
type: "OS::Heat::SoftwareConfig"
properties:
group: script
group: ungrouped
config: {get_file: fragments/configure-flannel.sh}
configure_flannel_deployment:
type: OS::Heat::SoftwareDeployment
depends_on: enable_etcd_deployment
properties:
config:
get_resource: configure_flannel
server:
get_resource: kube_master
enable_services:
type: "OS::Heat::SoftwareConfig"
properties:
group: script
group: ungrouped
config: {get_file: fragments/enable-services-master.sh}
enable_services_deployment:
type: OS::Heat::SoftwareDeployment
depends_on: configure_flannel_deployment
properties:
config:
get_resource: enable_services
server:
get_resource: kube_master
######################################################################
#
# databases server. this sets up a Kubernetes server
@ -193,8 +179,8 @@ resources:
kube_master_floating:
type: "OS::Neutron::FloatingIP"
properties:
floating_network_id:
get_param: external_network_id
floating_network:
get_param: external_network
port_id:
get_attr: [kube_master, addresses, {get_param: fixed_network}, 0, port]
@ -209,11 +195,14 @@ resources:
get_param: ssh_key_name
networks:
- network: {get_param: fixed_network}
user_data_format: SOFTWARE_CONFIG
user_data_format: RAW
user_data: {get_resource: kube_master_init}
kube_minions:
type: "OS::Heat::ResourceGroup"
depends_on: kube_master
depends_on:
- kube_master
- master_wait_condition
properties:
count: {get_param: number_of_minions}
removal_policies: [{resource_list: {get_param: minions_to_remove}}]
@ -225,7 +214,7 @@ resources:
server_flavor: {get_param: server_flavor}
fixed_network: {get_param: fixed_network}
kube_master_ip: {get_attr: [kube_master, networks, {get_param: fixed_network}, 0]}
external_network_id: {get_param: external_network_id}
external_network: {get_param: external_network}
kube_allow_priv: {get_param: kube_allow_priv}
outputs:

@ -9,7 +9,6 @@ parameters:
server_image:
type: string
default: centos-7-atomic-20150120
description: glance image used to boot the server
server_flavor:
@ -22,9 +21,9 @@ parameters:
description: name of ssh key to be provisioned on our server
default: lars
external_network_id:
external_network:
type: string
description: uuid of a network to use for floating ip addresses
description: uuid/name of a network to use for floating ip addresses
kube_allow_priv:
type: string
@ -41,20 +40,24 @@ parameters:
fixed_network:
type: string
description: Network from which to allocate fixed addresses.
wait_condition_timeout:
type: number
default: 6000
description : >
timeout for the Wait Conditions
resources:
node_wait_handle:
type: "AWS::CloudFormation::WaitConditionHandle"
type: OS::Heat::WaitConditionHandle
node_wait_condition:
type: "AWS::CloudFormation::WaitCondition"
type: OS::Heat::WaitCondition
depends_on:
- kube_node
properties:
Handle:
get_resource: node_wait_handle
Timeout: 6000
handle: {get_resource: node_wait_handle}
timeout: {get_param: wait_condition_timeout}
######################################################################
#
@ -74,12 +77,6 @@ resources:
"$KUBE_MASTER_IP": {get_param: kube_master_ip}
"$WAIT_HANDLE": {get_resource: node_wait_handle}
add_to_docker_group:
type: "OS::Heat::SoftwareConfig"
properties:
group: ungrouped
config: {get_file: fragments/add-to-docker-group.sh}
kube_register:
type: "OS::Heat::SoftwareConfig"
properties:
@ -116,11 +113,17 @@ resources:
group: ungrouped
config: {get_file: fragments/enable-services-minion.sh}
cfn_signal:
type: "OS::Heat::SoftwareConfig"
minion_wc_notify:
type: OS::Heat::SoftwareConfig
properties:
group: ungrouped
config: {get_file: fragments/cfn-signal.sh}
config:
str_replace:
template: |
#!/bin/bash -v
wc_notify --data-binary '{"status": "SUCCESS"}'
params:
wc_notify: {get_attr: [node_wait_handle, curl_cli]}
disable_selinux:
type: "OS::Heat::SoftwareConfig"
@ -136,12 +139,11 @@ resources:
- config: {get_resource: write_heat_params}
- config: {get_resource: kube_user}
- config: {get_resource: kube_examples}
- config: {get_resource: add_to_docker_group}
- config: {get_resource: kube_register}
- config: {get_resource: configure_kubernetes_minion}
- config: {get_resource: docker_service}
- config: {get_resource: enable_services}
- config: {get_resource: cfn_signal}
- config: {get_resource: minion_wc_notify}
kube_node:
type: "OS::Nova::Server"
@ -160,8 +162,8 @@ resources:
kube_node_floating:
type: "OS::Neutron::FloatingIP"
properties:
floating_network_id:
get_param: external_network_id
floating_network:
get_param: external_network
port_id:
get_attr: [kube_node, addresses, {get_param: fixed_network}, 0, port]

Loading…
Cancel
Save