Extract kubernetes baremetal ports

Previously the master's private IP address was not pushed through to the
minion configuration when the load balancer is disabled as the heat
templates were not wired up in this case.  This change resolves that
issue and makes it possible for security groups to be applied to the
master and minion ports.

Change-Id: If85a5434f014c5a09b54dda710d13739e9bff928
Related-Bug: #1544195
This commit is contained in:
Mark Goddard 2017-05-14 09:02:36 +01:00 committed by Spyros Trigazis (strigazi)
parent 1964ef0f34
commit 769f0eea41
3 changed files with 51 additions and 10 deletions

View File

@ -520,6 +520,9 @@ resources:
server_image: {get_param: server_image}
minion_flavor: {get_param: minion_flavor}
fixed_network: {get_param: fixed_network}
fixed_subnet: {get_param: fixed_subnet}
secgroup_kube_minion_id: {get_resource: secgroup_kube_minion}
flannel_network_cidr: {get_param: flannel_network_cidr}
external_network: {get_param: external_network}
kube_software_configs: {get_attr: [kubeminion_software_configs, kube_minion_init]}

View File

@ -240,8 +240,8 @@ resources:
properties:
pool_public_ip: {get_param: api_public_address}
pool_private_ip: {get_param: api_private_address}
master_public_ip: ''
master_private_ip: ''
master_public_ip: {get_attr: [kube_master_floating, floating_ip_address]}
master_private_ip: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]}
######################################################################
#
@ -472,7 +472,20 @@ resources:
user_data_format: RAW
user_data: {get_resource: kube_master_init}
networks:
- network: {get_param: fixed_network}
- port: {get_resource: kube_master_eth0}
kube_master_eth0:
type: "OS::Neutron::Port"
properties:
network_id:
get_param: fixed_network
security_groups:
- {get_param: secgroup_kube_master_id}
fixed_ips:
- subnet_id:
get_param: fixed_subnet
allowed_address_pairs:
- ip_address: {get_param: flannel_network_cidr}
kube_master_floating:
type: OS::Neutron::FloatingIP
@ -480,13 +493,13 @@ resources:
floating_network:
get_param: external_network
port_id:
get_attr: [kube-master, addresses, {get_param: fixed_network}, 0, port]
get_resource: kube_master_eth0
api_pool_member:
type: Magnum::Optional::Neutron::LBaaS::PoolMember
properties:
pool: {get_param: api_pool_id}
address: {get_attr: [kube-master, networks, private, 0]}
address: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]}
subnet: { get_param: fixed_subnet }
protocol_port: {get_param: kubernetes_port}
@ -494,14 +507,14 @@ resources:
type: Magnum::Optional::Neutron::LBaaS::PoolMember
properties:
pool: {get_param: etcd_pool_id}
address: {get_attr: [kube-master, networks, private, 0]}
address: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]}
subnet: { get_param: fixed_subnet }
protocol_port: 2379
outputs:
kube_master_ip:
value: {get_attr: [kube-master, networks, private, 0]}
value: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]}
description: >
This is the "private" IP address of the Kubernetes master node.

View File

@ -27,6 +27,18 @@ parameters:
type: string
description: Network from which to allocate fixed addresses.
fixed_subnet:
type: string
description: Subnet from which to allocate fixed addresses.
secgroup_kube_minion_id:
type: string
description: ID of the security group for kubernetes minion.
flannel_network_cidr:
type: string
description: network range for flannel overlay network
kube_software_configs:
type: string
description : >
@ -51,7 +63,20 @@ resources:
user_data_format: RAW
user_data: {get_param: kube_software_configs}
networks:
- network: {get_param: fixed_network}
- port: {get_resource: kube_minion_eth0}
kube_minion_eth0:
type: "OS::Neutron::Port"
properties:
network_id:
get_param: fixed_network
security_groups:
- {get_param: secgroup_kube_minion_id}
fixed_ips:
- subnet_id:
get_param: fixed_subnet
allowed_address_pairs:
- ip_address: {get_param: flannel_network_cidr}
kube_minion_floating:
type: OS::Neutron::FloatingIP
@ -59,12 +84,12 @@ resources:
floating_network:
get_param: external_network
port_id:
get_attr: [kube-minion, addresses, {get_param: fixed_network}, 0, port]
get_resource: kube_minion_eth0
outputs:
kube_minion_ip:
value: {get_attr: [kube-minion, networks, private, 0]}
value: {get_attr: [kube_minion_eth0, fixed_ips, 0, ip_address]}
description: >
This is the "public" IP address of the Kubernetes minion node.