Skip to content

Commit 560e318

Browse files
committed
OpenStack: add SG rules for compact clusters on UPI
Compact clusters have been supported for a while in IPI. To also allow compact clusters on UPI, the security group rules for UPI should be adapted enabling the same ingress traffic that is enabled for workers.
1 parent d4ebae5 commit 560e318

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

docs/user/openstack/install_upi.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ of this method of installation.
3333
- [Modify NetworkType (Required for Kuryr SDN)](#modify-networktype-required-for-kuryr-sdn)
3434
- [Edit Manifests](#edit-manifests)
3535
- [Remove Machines and MachineSets](#remove-machines-and-machinesets)
36-
- [Make control-plane nodes unschedulable](#make-control-plane-nodes-unschedulable)
36+
- [Set control-plane nodes to desired schedulable state](#set-control-plane-nodes-to-desired-schedulable-state)
3737
- [Ignition Config](#ignition-config)
3838
- [Infra ID](#infra-id)
3939
- [Bootstrap Ignition](#bootstrap-ignition)
@@ -489,22 +489,26 @@ Leave the compute MachineSets in if you want to create compute machines via the
489489
[mao]: https://github.com/openshift/machine-api-operator
490490
[ccpmso]: https://github.com/openshift/cluster-control-plane-machine-set-operator
491491

492-
### Make control-plane nodes unschedulable
492+
### Set control-plane nodes to desired schedulable state
493493

494-
Currently [emptying the compute pools][empty-compute-pools] makes control-plane nodes schedulable. But due to a [Kubernetes limitation][kubebug], router pods running on control-plane nodes will not be reachable by the ingress load balancer. Update the scheduler configuration to keep router pods and other workloads off the control-plane nodes:
494+
Currently [emptying the compute pools][empty-compute-pools] makes control-plane nodes schedulable. Let's update the scheduler configuration to match the desired configuration defined on the `inventory.yaml`:
495495
<!--- e2e-openstack-upi: INCLUDE START --->
496496
```sh
497497
$ python -c '
498498
import yaml
499+
inventory = yaml.safe_load(open("inventory.yaml"))
500+
inventory_os_compute_nodes_number = inventory["all"]["hosts"]["localhost"]["os_compute_nodes_number"]
499501
path = "manifests/cluster-scheduler-02-config.yml"
500502
data = yaml.safe_load(open(path))
501-
data["spec"]["mastersSchedulable"] = False
503+
if not inventory_os_compute_nodes_number:
504+
data["spec"]["mastersSchedulable"] = True
505+
else:
506+
data["spec"]["mastersSchedulable"] = False
502507
open(path, "w").write(yaml.dump(data, default_flow_style=False))'
503508
```
504509
<!--- e2e-openstack-upi: INCLUDE END --->
505510

506511
[empty-compute-pools]: #empty-compute-pools
507-
[kubebug]: https://github.com/kubernetes/kubernetes/issues/65618
508512

509513
## Ignition Config
510514

upi/openstack/inventory.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ all:
2525
os_cp_nodes_number: 3
2626

2727
# Number of provisioned Compute nodes.
28-
# 3 is the minimum number for a fully-functional cluster.
2928
os_compute_nodes_number: 3
3029

3130
# The IP addresses of DNS servers to be used for the DNS resolution of
@@ -70,3 +69,6 @@ all:
7069
# Be aware that the 10 and 11 of the machineNetwork will
7170
# be taken by neutron dhcp by default, and wont be available.
7271
os_ingressVIP: "{{ os_subnet_range | ansible.utils.next_nth_usable(7) }}"
72+
73+
# Set control-plane nodes to schedule workloads when number of compute nodes is zero
74+
os_master_schedulable: "{{ os_compute_nodes_number | int == 0 }}"

upi/openstack/security-groups.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,30 @@
180180
protocol: '112'
181181
remote_ip_prefix: "{{ os_subnet_range }}"
182182

183+
- name: 'Create master-sg rule "master ingress HTTP (TCP)"'
184+
openstack.cloud.security_group_rule:
185+
security_group: "{{ os_sg_master }}"
186+
protocol: tcp
187+
port_range_min: 80
188+
port_range_max: 80
189+
when: os_master_schedulable is defined and os_master_schedulable
190+
191+
- name: 'Create master-sg rule "master ingress HTTPS (TCP)"'
192+
openstack.cloud.security_group_rule:
193+
security_group: "{{ os_sg_master }}"
194+
protocol: tcp
195+
port_range_min: 443
196+
port_range_max: 443
197+
when: os_master_schedulable is defined and os_master_schedulable
198+
199+
- name: 'Create master-sg rule "router"'
200+
openstack.cloud.security_group_rule:
201+
security_group: "{{ os_sg_master }}"
202+
protocol: tcp
203+
remote_ip_prefix: "{{ os_subnet_range }}"
204+
port_range_min: 1936
205+
port_range_max: 1936
206+
when: os_master_schedulable is defined and os_master_schedulable
183207

184208
- name: 'Create worker-sg rule "ICMP"'
185209
openstack.cloud.security_group_rule:

0 commit comments

Comments
 (0)