Skip to content

Commit

Permalink
openstack UPI: Optional floating IPs
Browse files Browse the repository at this point in the history
Add the option to disable the use of floating IPs.
  • Loading branch information
pierreprinetti committed Jul 30, 2020
1 parent 7e8d172 commit 5b45386
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
4 changes: 3 additions & 1 deletion docs/user/openstack/install_upi.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The requirements for UPI are broadly similar to the [ones for OpenStack IPI][ipi
- input in the `openshift-install` wizard
- Nova flavors
- inventory: `os_flavor_master` and `os_flavor_worker`
- An external subnet you want to use for floating IP addresses
- An external subnet you want to use for floating IP addresses (if FIPs are used)
- inventory: `os_external_network`
- The `openshift-install` binary
- A subnet range for the Nova servers / OpenShift Nodes, that does not conflict with your existing network
Expand Down Expand Up @@ -186,6 +186,8 @@ $ openstack image show rhcos

## API and Ingress Floating IP Addresses

If the variables `os_api_fip` and `os_ingress_fip` are found in `inventory.yaml`, the corresponding floating IPs will be attached to the API load balancer and to the worker nodes load balancer respectively. Note that `os_external_network` is a requirement for those. If `os_external_network` is found in `inventory.yaml`, the playbooks will create and attach an additional floating IP to the bootstrap machine.

**NOTE**: throughout this document, we will use `203.0.113.23` as the public IP address for the OpenShift API endpoint and `203.0.113.19` as the public IP for the ingress (`*.apps`) endpoint.

```sh
Expand Down
1 change: 1 addition & 0 deletions upi/openstack/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@
state: present
network: "{{ os_external_network }}"
server: "{{ os_bootstrap_server_name }}"
when: os_external_network is defined and os_external_network|length>0
22 changes: 17 additions & 5 deletions upi/openstack/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ all:
os_flavor_master: 'm1.xlarge'
os_flavor_worker: 'm1.large'
os_image_rhcos: 'rhcos'
os_external_network: 'external'
# OpenShift API floating IP address
os_api_fip: '203.0.113.23'
# OpenShift Ingress floating IP address
os_ingress_fip: '203.0.113.19'
# Service subnet cidr
svc_subnet_range: '172.30.0.0/16'
os_svc_network_range: '172.30.0.0/15'
Expand All @@ -32,3 +27,20 @@ all:
# Number of provisioned Compute nodes.
# 3 is the minimum number for a fully-functional cluster.
os_compute_nodes_number: 3

# The public network, if available. Required for os_api_fip and
# os_ingress_fip.
# If non-empty, an additional floating IP will be created and attached to
# the bootstrap machine to allow the retrieval of a log bundle in case of
# install failure ('must-gather').
os_external_network: 'external'

# OpenShift API floating IP address. If this value is non-empty, the
# corresponding floating IP will be attached to the Control Plane to
# serve the OpenShift API.
os_api_fip: '203.0.113.23'

# OpenShift Ingress floating IP address. If this value is non-empty, the
# corresponding floating IP will be attached to the worker nodes to serve
# the applications.
os_ingress_fip: '203.0.113.19'
7 changes: 6 additions & 1 deletion upi/openstack/network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@
network: "{{ os_external_network }}"
interfaces:
- "{{ os_subnet }}"
when: os_external_network is defined and os_external_network|length>0

- name: 'Set external router tag'
command:
cmd: "openstack router set --tag {{ cluster_id_tag }} {{ os_router }}"
when: os_networking_type == "Kuryr"
when:
- os_networking_type == "Kuryr"
- os_external_network is defined and os_external_network|length>0

- name: 'Create the API port'
os_port:
Expand Down Expand Up @@ -145,9 +148,11 @@
- name: 'Attach the API floating IP to API port'
command:
cmd: "openstack floating ip set --port {{ os_port_api }} {{ os_api_fip }}"
when: os_api_fip is defined and os_api_fip|length>0

# NOTE: openstack ansible module doesn't allow attaching Floating IPs to
# ports, let's use the CLI instead
- name: 'Attach the Ingress floating IP to Ingress port'
command:
cmd: "openstack floating ip set --port {{ os_port_ingress }} {{ os_ingress_fip }}"
when: os_ingress_fip is defined and os_ingress_fip|length>0

0 comments on commit 5b45386

Please sign in to comment.