Skip to content

Commit

Permalink
Allow minion floating IPs to be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Hannaford committed Mar 7, 2017
1 parent 302aab9 commit 4eef540
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cluster/openstack-heat/config-default.sh
Expand Up @@ -73,3 +73,6 @@ SOCKS_PROXY=${SOCKS_PROXY:-}

# IPs and Domains that bypass the proxy.
NO_PROXY=${NO_PROXY:-}

# Whether to assign floating IPs to minions
ASSIGN_FLOATING_IP=${ASSIGN_FLOATING_IP:-true}
6 changes: 6 additions & 0 deletions cluster/openstack-heat/kubernetes-heat/kubecluster.yaml
Expand Up @@ -161,6 +161,11 @@ parameters:
type: string
description: Comma seperated list of domains/addresses that bypass proxying.
default: localhost

assign_floating_ip:
type: boolean
description: Indicates whether floating IPs will be generated for minions
default: true

resources:

Expand Down Expand Up @@ -435,6 +440,7 @@ resources:
https_proxy: {get_param: https_proxy }
socks_proxy: {get_param: socks_proxy }
no_proxy: {get_param: no_proxy }
assign_floating_ip: {get_param: assign_floating_ip }
min_size: {get_param: number_of_minions}
desired_capacity: {get_param: number_of_minions}
max_size: {get_param: max_number_of_minions}
Expand Down
11 changes: 11 additions & 0 deletions cluster/openstack-heat/kubernetes-heat/kubeminion.yaml
Expand Up @@ -100,6 +100,11 @@ parameters:
description: Comma seperated list of domains/addresses that bypass proxying.
default: localhost

assign_floating_ip:
type: boolean
description: Indicates whether floating IPs will be generated for minions
default: true

# The following are all generated in the parent template.
kube_master_ip:
type: string
Expand Down Expand Up @@ -127,6 +132,9 @@ parameters:
secgroup_node:
type: string

conditions:
assign_floating_ip: {equals : [{get_param: assign_floating_ip}, true]}

resources:

minion_wait_handle:
Expand Down Expand Up @@ -294,10 +302,13 @@ resources:
properties:
floating_network: {get_param: external_network}
port_id: {get_resource: kube_minion_eth0}
condition: assign_floating_ip

outputs:

kube_minion_ip:
value: {get_attr: [kube_minion_eth0, fixed_ips, 0, ip_address]}

kube_minion_external_ip:
value: {get_attr: [kube_minion_floating, floating_ip_address]}
condition: assign_floating_ip
1 change: 1 addition & 0 deletions cluster/openstack-heat/util.sh
Expand Up @@ -233,6 +233,7 @@ function run-heat-script() {
--parameter https_proxy="${HTTPS_PROXY}" \
--parameter socks_proxy="${SOCKS_PROXY}" \
--parameter no_proxy="${NO_PROXY}" \
--parameter assign_floating_ip="${ASSIGN_FLOATING_IP}" \
--template kubecluster.yaml \
${STACK_NAME}
)
Expand Down

0 comments on commit 4eef540

Please sign in to comment.