Skip to content

Commit 6c1ad63

Browse files
committed
Add bgp-l3-xl dt
This commit adds a "bgp-l3-xl" dt where workers/computes/networkers are deployed across three racks over a virtualized spine/leaf fabric using bgp. The overall footprint consists of 3 masters, 9 workers (3x rack), 6 computes (2x rack), 3 networkers (1x rack) plus 1 router, 2 spines and 6 leaf switches (2x rack). ~~~ $ virsh list Id Name State ---------------------------------------- 1292 cifmw-controller-0 running 1293 cifmw-r0-compute-0 running 1294 cifmw-r0-compute-1 running 1295 cifmw-r1-compute-0 running 1296 cifmw-r1-compute-1 running 1297 cifmw-r2-compute-0 running 1298 cifmw-r2-compute-1 running 1299 cifmw-r0-networker-0 running 1300 cifmw-r1-networker-0 running 1301 cifmw-r2-networker-0 running 1302 cifmw-ocp-master-0 running 1303 cifmw-ocp-master-1 running 1304 cifmw-ocp-master-2 running 1305 cifmw-ocp-worker-0 running 1306 cifmw-ocp-worker-1 running 1307 cifmw-ocp-worker-2 running 1308 cifmw-ocp-worker-3 running 1309 cifmw-ocp-worker-4 running 1310 cifmw-ocp-worker-5 running 1311 cifmw-ocp-worker-6 running 1312 cifmw-ocp-worker-7 running 1313 cifmw-ocp-worker-8 running 1314 cifmw-ocp-worker-9 running 1315 cifmw-router-0 running 1316 cifmw-spine-0 running 1317 cifmw-spine-1 running 1318 cifmw-leaf-0 running 1319 cifmw-leaf-1 running 1320 cifmw-leaf-2 running 1321 cifmw-leaf-3 running 1322 cifmw-leaf-4 running 1323 cifmw-leaf-5 running ~~~
1 parent 0798e76 commit 6c1ad63

File tree

17 files changed

+2305
-2
lines changed

17 files changed

+2305
-2
lines changed

.github/CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ roles/adoption_osp_deploy @openstack-k8s-operators/adoption-core-reviewers
66

77
# BGP
88
roles/ci_gen_kustomize_values/templates/bgp_dt01 @openstack-k8s-operators/bgp
9+
roles/ci_gen_kustomize_values/templates/bgp-l3-xl @openstack-k8s-operators/bgp
910
playbooks/bgp-l3-computes-ready.yml @openstack-k8s-operators/bgp
11+
playbooks/bgp @openstack-k8s-operators/bgp
12+
scenarios/reproducers/bgp-l3-xl.yml @openstack-k8s-operators/bgp
1013

1114
# Compliance
1215
roles/compliance @openstack-k8s-operators/security
+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
- name: Configure computes
3+
hosts: "computes{{ networkers_bool | default(false) | bool | ternary(',networkers', '') }}"
4+
tasks:
5+
- name: Check default route corresponds with BGP
6+
ansible.builtin.command:
7+
cmd: "ip route show default"
8+
register: _initial_default_ip_route_result
9+
changed_when: false
10+
11+
- name: Early end if default route is already based on BGP
12+
ansible.builtin.meta: end_play
13+
when: "'proto bgp' in _initial_default_ip_route_result.stdout"
14+
15+
- name: Obtain the device with the DHCP default route
16+
ansible.builtin.shell:
17+
cmd: >
18+
ip r show default |
19+
grep "proto dhcp" |
20+
grep -o "dev \w*" |
21+
cut -d" " -f 2
22+
ignore_errors: true
23+
register: dhcp_default_route_device
24+
changed_when: false
25+
26+
- name: Remove DHCP default route if it exists
27+
when:
28+
- dhcp_default_route_device.rc == 0
29+
- dhcp_default_route_device.stdout | trim | length > 0
30+
vars:
31+
default_device: "{{ dhcp_default_route_device.stdout | trim }}"
32+
block:
33+
- name: Obtain the connection for the DHCP default route device
34+
ansible.builtin.command:
35+
cmd: >
36+
nmcli -g GENERAL.CONNECTION device show {{ default_device }}
37+
register: default_connection
38+
changed_when: false
39+
40+
- name: Ignore dhcp default route from ocpbm interfaces
41+
become: true
42+
community.general.nmcli:
43+
conn_name: "{{ default_connection.stdout | trim }}"
44+
gw4_ignore_auto: true
45+
gw6_ignore_auto: true
46+
never_default4: true
47+
state: present
48+
49+
- name: Remove default route obtained via DHCP from leafs in order to apply BGP
50+
become: true
51+
ansible.builtin.shell:
52+
cmd: >
53+
set -o pipefail && ip route show default |
54+
grep "proto dhcp" |
55+
xargs -r ip route del
56+
changed_when: false
57+
58+
- name: Restart NetworkManager
59+
become: true
60+
ansible.builtin.systemd:
61+
name: NetworkManager.service
62+
state: restarted
63+
64+
- name: Check new default route corresponds with BGP
65+
ansible.builtin.command:
66+
cmd: "ip route show default"
67+
register: default_ip_route_result
68+
retries: 10
69+
delay: 1
70+
until: "'proto bgp' in default_ip_route_result.stdout"
71+
changed_when: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
- name: Prepare the BGP hypervisor with needed configuration
3+
hosts: hypervisor
4+
tasks:
5+
- name: Set IPv4 forwarding
6+
become: true
7+
ansible.posix.sysctl:
8+
name: net.ipv4.ip_forward
9+
value: '1'
10+
sysctl_set: true
11+
sysctl_file: /etc/sysctl.d/90-network.conf
12+
state: present
13+
reload: true
14+
15+
- name: Disable reverse path forwarding validation
16+
become: true
17+
ansible.posix.sysctl:
18+
name: net.ipv4.conf.all.rp_filter
19+
value: '0'
20+
sysctl_set: true
21+
sysctl_file: /etc/sysctl.d/90-network.conf
22+
state: present
23+
reload: true

0 commit comments

Comments
 (0)