Skip to content

Commit c59a824

Browse files
Merge pull request #7576 from shiftstack/upi-compact-clusters
OCPBUGS-20403: OpenStack: add SG rules for compact clusters on UPI
2 parents 43a82ab + 560e318 commit c59a824

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
@@ -27,7 +27,6 @@ all:
2727
os_cp_nodes_number: 3
2828

2929
# Number of provisioned Compute nodes.
30-
# 3 is the minimum number for a fully-functional cluster.
3130
os_compute_nodes_number: 3
3231

3332
# The IP addresses of DNS servers to be used for the DNS resolution of
@@ -72,3 +71,6 @@ all:
7271
# Be aware that the 10 and 11 of the machineNetwork will
7372
# be taken by neutron dhcp by default, and wont be available.
7473
os_ingressVIP: "{{ os_subnet_range | ansible.utils.next_nth_usable(7) }}"
74+
75+
# Set control-plane nodes to schedule workloads when number of compute nodes is zero
76+
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
@@ -191,6 +191,30 @@
191191
protocol: '112'
192192
remote_ip_prefix: "{{ os_subnet_range }}"
193193

194+
- name: 'Create master-sg rule "master ingress HTTP (TCP)"'
195+
openstack.cloud.security_group_rule:
196+
security_group: "{{ os_sg_master }}"
197+
protocol: tcp
198+
port_range_min: 80
199+
port_range_max: 80
200+
when: os_master_schedulable is defined and os_master_schedulable
201+
202+
- name: 'Create master-sg rule "master ingress HTTPS (TCP)"'
203+
openstack.cloud.security_group_rule:
204+
security_group: "{{ os_sg_master }}"
205+
protocol: tcp
206+
port_range_min: 443
207+
port_range_max: 443
208+
when: os_master_schedulable is defined and os_master_schedulable
209+
210+
- name: 'Create master-sg rule "router"'
211+
openstack.cloud.security_group_rule:
212+
security_group: "{{ os_sg_master }}"
213+
protocol: tcp
214+
remote_ip_prefix: "{{ os_subnet_range }}"
215+
port_range_min: 1936
216+
port_range_max: 1936
217+
when: os_master_schedulable is defined and os_master_schedulable
194218

195219
- name: 'Create worker-sg rule "ICMP"'
196220
openstack.cloud.security_group_rule:

0 commit comments

Comments
 (0)