forked from openstack/kolla-ansible
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for deploying OVN SB relays [1]. This is enabled by default to improve large scale scenarios. Default mechanism deploys one relay group per 50 ovn-controller hosts and uses random but idempotent method to choose a relay for a given host. neutron-server will connect directly to SB cluster, not via the relays. [1]: https://docs.ovn.org/en/latest/tutorials/ovn-ovsdb-relay.html Co-Authored-By: Krzysztof Tomaszewski <[email protected]> Depends-On: https://review.opendev.org/c/openstack/kolla/+/928898 Change-Id: Id7d6973668d8b2b194913b533f8cb756c6708536 (cherry picked from commit 7b95939)
- Loading branch information
1 parent
f890617
commit de72559
Showing
20 changed files
with
272 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
- name: Ensuring config directories exist for OVN relay containers | ||
vars: | ||
ovn_sb_db_relay_group_id: "{{ item }}" | ||
file: | ||
path: "{{ node_config_directory }}/ovn-sb-db-relay-{{ item }}" | ||
state: "directory" | ||
owner: "{{ config_owner_user }}" | ||
group: "{{ config_owner_group }}" | ||
mode: "0770" | ||
become: true | ||
|
||
- name: Copying over config.json files for OVN relay services | ||
vars: | ||
# NOTE(mnasiadka): Used in the ovn_sb_relay_command template in defaults/main.yml | ||
ovn_sb_db_relay_group_id: "{{ item }}" | ||
template: | ||
src: "ovn-sb-db-relay.json.j2" | ||
dest: "{{ node_config_directory }}/ovn-sb-db-relay-{{ item }}/config.json" | ||
mode: "0660" | ||
become: true | ||
notify: | ||
- Restart ovn-sb-db-relay container | ||
|
||
- name: Generate config files for OVN relay services | ||
vars: | ||
# NOTE(mnasiadka): Used in the ovn_sb_relay_command template in defaults/main.yml | ||
ovn_sb_db_relay_group_id: "{{ item }}" | ||
template: | ||
src: "ovsdb-relay.json.j2" | ||
dest: "{{ node_config_directory }}/ovn-sb-db-relay-{{ item }}/ovsdb-relay.json" | ||
mode: "0660" | ||
become: true | ||
notify: | ||
- Restart ovn-sb-db-relay container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"command": "{{ ovn_sb_relay_command }}", | ||
"config_files": [ | ||
{ | ||
"source": "{{ container_config_directory }}/ovsdb-relay.json", | ||
"dest": "/etc/ovn/ovsdb-relay.json", | ||
"owner": "openvswitch", | ||
"perm": "0600" | ||
} | ||
], | ||
"permissions": [ | ||
{ | ||
"path": "/var/log/kolla/openvswitch", | ||
"owner": "root:root", | ||
"recurse": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
{ | ||
"remotes": { | ||
"ptcp:{{ ovn_sb_db_relay_port_prefix ~ ovn_sb_db_relay_group_id }}:{{ api_interface_address | put_address_in_context('url') }}": { | ||
"inactivity-probe": {{ ovn_sb_db_relay_passive_inactivity_probe }} | ||
} | ||
}, | ||
"databases": { | ||
"OVN_Southbound": { | ||
"service-model": "relay", | ||
"source": { | ||
"{{ ovn_sb_connection_no_relay }}": { | ||
"inactivity-probe": {{ ovn_sb_db_relay_active_inactivity_probe }}, | ||
"max-backoff": {{ ovn_sb_db_relay_max_backoff }} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: "{{ kolla_role_name | default(project_name) }} | Check containers with iteration" | ||
become: true | ||
vars: | ||
service: "{{ outer_item.value }}" | ||
kolla_container: | ||
action: "compare_container" | ||
common_options: "{{ docker_common_options }}" | ||
name: "{{ service.container_name }}" | ||
image: "{{ service.image | default(omit) }}" | ||
volumes: "{{ service.volumes | default(omit) }}" | ||
dimensions: "{{ service.dimensions | default(omit) }}" | ||
tmpfs: "{{ service.tmpfs | default(omit) }}" | ||
volumes_from: "{{ service.volumes_from | default(omit) }}" | ||
privileged: "{{ service.privileged | default(omit) }}" | ||
cap_add: "{{ service.cap_add | default(omit) }}" | ||
environment: "{{ service.environment | default(omit) }}" | ||
healthcheck: "{{ service.healthcheck | default(omit) }}" | ||
ipc_mode: "{{ service.ipc_mode | default(omit) }}" | ||
pid_mode: "{{ service.pid_mode | default(omit) }}" | ||
security_opt: "{{ service.security_opt | default(omit) }}" | ||
labels: "{{ service.labels | default(omit) }}" | ||
command: "{{ service.command | default(omit) }}" | ||
cgroupns_mode: "{{ service.cgroupns_mode | default(omit) }}" | ||
loop: | ||
- "{{ range(1,(service.iterate_var | int) + 1) | list }}" | ||
register: container_check | ||
|
||
# NOTE(yoctozepto): Must be a separate task because one cannot see the whole | ||
# result in the previous task and Ansible has a quirk regarding notifiers. | ||
# For details see https://github.com/ansible/ansible/issues/22579 | ||
- name: "{{ kolla_role_name | default(project_name) }} | Notify handlers to restart containers" | ||
debug: | ||
msg: Notifying handlers | ||
changed_when: container_check is changed | ||
notify: "Restart {{ outer_item.key }} container" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.