Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from deprecated Neutron LBaaS API to LBaaSv2 #399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions loadbalancer_dedicated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,15 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

member_ips:
type: comma_delimited_list

master_hostname:
type: string

Expand Down
6 changes: 6 additions & 0 deletions loadbalancer_external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,15 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

member_ips:
type: comma_delimited_list

master_hostname:
type: string

Expand Down
6 changes: 6 additions & 0 deletions loadbalancer_neutron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,15 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

member_ips:
type: comma_delimited_list

master_hostname:
type: string

Expand Down
257 changes: 257 additions & 0 deletions loadbalancer_neutron_v2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
heat_template_version: 2016-10-14

description: >
A template which provides a creates a loadbalancer using neutron's LBaaS.

parameters:

# What version of OpenShift Container Platform to install
# This value is used to select the RPM repo for the OCP release to install
ocp_version:
type: string
description: >
The version of OpenShift Container Platform to deploy

key_name:
description: >
A pre-submitted SSH key to access the VM hosts
type: string
constraints:
- custom_constraint: nova.keypair

image:
type: string
default: ''

flavor:
description: >
Define the hardware characteristics for the VMs: CPU, Memory, base disk
type: string
constraints:
- custom_constraint: nova.flavor

hostname:
description: >
The load balancer hostname portion of the FQDN
type: string
constraints:
- allowed_pattern: '[a-z0-9\-\.]*'
description: Hostname must contain only characters [a-z0-9\-\.].

stack_name:
description: Top level stack name.
type: string

domain_name:
description: >
All VMs will be placed in this domain
type: string

app_subdomain:
type: string

rhn_username:
description: >
A valid user with entitlements to RHEL and OpenShift software repos
type: string

rhn_password:
description: >
The password for the RHN user
type: string
hidden: true

# Red Hat satellite subscription parameters
sat6_hostname:
type: string
description: >
The hostname of the Satellite 6 server which will provide software updates
default: ''

sat6_organization:
type: string
description: >
An organization string provided by Sat6 to group subscriptions
default: ''

sat6_activationkey:
type: string
description: >
An activation key string provided by Sat6 to enable subscriptions

rhn_pool:
description: >
A subscription pool containing the RHEL and OpenShift software repos
OPTIONAL
type: string
hidden: true

extra_rhn_pools:
type: comma_delimited_list
description: List of rhn pools which will be installed on each node.
default: ''

ssh_user:
description: >
The user for SSH access to the VM hosts
type: string

ansible_public_key:
description: >
The SSH public key that Ansible will use to access master and node hosts
This will be placed on each VM host in /root/.ssh/authorized_keys
type: string

fixed_subnet:
description: >
The name or ID of the internal IPv4 space
type: string
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

member_ips:
type: comma_delimited_list

master_hostname:
type: string

floatingip_id:
type: string

floatingip:
type: string

fixed_network:
description: >
The name or ID of the internal network
type: string
constraints:
- custom_constraint: neutron.network

fixed_subnet:
description: >
The name or ID of the internal IPv4 space
type: string
constraints:
- custom_constraint: neutron.subnet

extra_repository_urls:
type: comma_delimited_list
description: List of repository URLs which will be installed on each node.
default: ''

extra_docker_repository_urls:
type: comma_delimited_list
description: List of docker repository URLs which will be installed on each node, if a repo is insecure use '#insecure' suffix.
default: ''

stack_name:
type: string
default: ''

bastion_node:
type: string
description: >
The name or ID of the bastion instance.
default: ''

dns_servers:
type: comma_delimited_list
description: address of dns nameservers reachable in your environment

dns_update_key:
type: string
hidden: true

ca_cert:
type: string
description: Certificate Authority Certificate to be added to trust chain

resources:
lb:
type: OS::Neutron::LBaaS::LoadBalancer
properties:
vip_subnet: {get_param: fixed_subnet}

lb_listener:
type: OS::Neutron::LBaaS::Listener
properties:
protocol: HTTPS
protocol_port: 8443
loadbalancer: {get_resource: lb}

lb_pool:
type: OS::Neutron::LBaaS::Pool
properties:
name: lb_pool
description: Load balancer for OpenShift hosts.
protocol: HTTPS
listener: {get_resource: lb_listener}
lb_algorithm: ROUND_ROBIN
session_persistence:
type: SOURCE_IP

lb_members:
type: OS::Heat::ResourceGroup
properties:
count: {get_param: member_count}
resource_def:
type: loadbalancer_neutron_v2_member.yaml
properties:
addresses: {get_param: member_ips}
index: "%index%"
pool: {get_resource: lb_pool}
protocol_port: 8443
subnet: {get_param: fixed_subnet}

lb_monitor:
type: OS::Neutron::LBaaS::HealthMonitor
properties:
type: TCP
delay: 15
max_retries: 5
timeout: 10
pool: {get_resource: lb_pool}

floating_ip_assoc:
type: OS::Neutron::FloatingIPAssociation
properties:
port_id: {get_attr: [lb, vip_port_id]}
floatingip_id: {get_param: floatingip_id}

outputs:
console_url:
description: URL of the OpenShift web console
value:
str_replace:
template: "https://%stack_name%-%hostname%.%domainname%:8443/console/"
params:
'%stack_name%': {get_param: stack_name}
'%hostname%': {get_param: hostname}
'%domainname%': {get_param: domain_name}

api_url:
description: URL entrypoint to the OpenShift API
value:
str_replace:
template: "https://%stack_name%-%hostname%.%domainname%:8443/"
params:
'%stack_name%': {get_param: stack_name}
'%hostname%': {get_param: hostname}
'%domainname%': {get_param: domain_name}

hostname:
description: Loadbalancer hostname
value:
str_replace:
template: "%stack_name%-%hostname%.%domainname%"
params:
'%stack_name%': {get_param: stack_name}
'%hostname%': {get_param: hostname}
'%domainname%': {get_param: domain_name}
60 changes: 60 additions & 0 deletions loadbalancer_neutron_v2_member.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
heat_template_version: 2016-10-14

description: >
A template which provides a neutron’s LBaaS loadbalancer member

parameters:

addresses:
type: comma_delimited_list

index:
type: number

pool:
type: string
constraints:
- custom_constraint: neutron.lbaas.pool

protocol_port:
type: number
constraints:
- range:
min: 1
max: 65535

subnet:
type: string
constraints:
- custom_constraint: neutron.subnet

weight:
type: number
constraints:
- range:
min: 0
max: 256
default: 1

resources:
lb_member:
type: OS::Neutron::LBaaS::PoolMember
properties:
address: {get_param: [addresses, {get_param: index}]}
pool: {get_param: pool}
protocol_port: {get_param: protocol_port}
subnet: {get_param: subnet}
weight: {get_param: weight}

outputs:
address:
description: The IP address of the pool member
value: {get_attr: [lb_member, address]}

pool_id:
description: The ID of the pool to which the pool member belongs
value: {get_attr: [lb_member, pool_id]}

show:
description: Detailed information about resource
value: {get_attr: [lb_member, show]}
6 changes: 6 additions & 0 deletions loadbalancer_none.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,15 @@ parameters:
constraints:
- custom_constraint: neutron.subnet

member_count:
type: number

members:
type: comma_delimited_list

member_ips:
type: comma_delimited_list

master_hostname:
type: string

Expand Down
2 changes: 2 additions & 0 deletions openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,9 @@ resources:
stack_name: {get_param: 'OS::stack_name'}
ansible_public_key: {get_attr: [ansible_keys, public_key]}
fixed_subnet: {get_resource: fixed_subnet}
member_count: {get_param: master_count}
members: {get_attr: [openshift_masters, host]}
member_ips: {get_attr: [openshift_masters, ip_address]}
master_hostname: {get_attr: [openshift_masters, resource.0.hostname]}
floatingip_id: {get_resource: lb_floating_ip}
floatingip: {get_attr: [lb_floating_ip, floating_ip_address]}
Expand Down