Allow more fine-grained groups for ironic, loadbalancer & network

Kayobe has fairly coarse-grained default groups - controller, compute,
etc, which work well in the majority of cases. Kolla Ansible allows much
more fine-grained placement on a per-service basis, e.g.
ironic-conductor. If the operator has taken advantage of this
fine-grained placement, then it is possible that some of the assumptions
in Kayobe may be incorrect. This is one downside of the split between
Kayobe and Kolla Ansible.

For example, Ironic conductor services may have been moved to a subset
of the top level 'controllers' group. In this case, we would not want
the Ironic networks to be mapped to all hosts in the controllers group -
only those running Ironic conductor services. The same argument can be
made if the loadbalancer services (HAProxy & keepalived) or Neutron
dataplane services (e.g. L3 & DHCP agents) have been separated from the
top level 'network' group.

This change abstracts the placement of Ironic conductor Ironic
inspector, loadbalancer and network services into separate variables,
rather than referencing the top level 'controllers' and 'network' groups
directly. These variables may be updated by the operator to match the
service placement.

Change-Id: Idbf181c795ee98ad653f11ae483f9dab4ef1b599
This commit is contained in:
Mark Goddard 2022-01-21 13:48:30 +00:00
parent bd9043dca0
commit 2071dc9a38
8 changed files with 103 additions and 15 deletions

View File

@ -6,6 +6,25 @@
# to setup the Kayobe user account. Default is {{ os_distribution }}.
controller_bootstrap_user: "{{ os_distribution }}"
###############################################################################
# Controller groups.
# Ansible inventory group in which Ironic conductor services are deployed.
# Default is 'controllers'.
controller_ironic_conductor_group: controllers
# Ansible inventory group in which Ironic inspector services are deployed.
# Default is 'controllers'.
controller_ironic_inspector_group: controllers
# Ansible inventory group in which control plane load balancer services are
# deployed. Default is 'network'.
controller_loadbalancer_group: network
# Ansible inventory group in which network data plane services are deployed.
# Default is 'network'.
controller_network_group: network
###############################################################################
# Controller network interface configuration.

View File

@ -57,7 +57,7 @@ kolla_neutron_ml2_generic_switch_hosts: []
# These hosts will be matched against the description fields in the
# switch_interface_config variable for each switch to determine which
# interfaces should be configured.
kolla_neutron_ml2_generic_switch_trunk_port_hosts: "{{ groups['network'] }}"
kolla_neutron_ml2_generic_switch_trunk_port_hosts: "{{ groups[controller_network_group] }}"
# Dict containing additional configuration for switches managed by the
# genericswitch ML2 mechanism driver. For per-switch configuration of switches

View File

@ -65,7 +65,7 @@
({{ item.description }}) is invalid. Value:
"{{ hostvars[inventory_hostname][item.var_name] | default('<undefined>') }}".
when:
- groups['network'] | length > 0
- groups[controller_loadbalancer_group] | length > 0
- item.required | bool
with_items:
- var_name: "kolla_internal_vip_address"
@ -112,6 +112,7 @@
kolla_globals_paths_static:
- "{{ kayobe_config_path }}"
kolla_globals_paths_extra: "{{ kolla_globals_paths_static + kayobe_env_search_paths }}"
kolla_ironic_inspector_host: "{{ groups[controller_ironic_inspector_group][0] if groups[controller_ironic_inspector_group] | length > 0 else '' }}"
- name: Generate Kolla Ansible host vars for the seed host
hosts: seed
@ -154,7 +155,7 @@
vars:
require_ironic_networks: >-
{{ kolla_enable_ironic | bool and
inventory_hostname in groups['controllers'] }}
inventory_hostname in groups[controller_ironic_conductor_group] }}
ironic_networks:
- network: "{{ provision_wl_net_name }}"
required: "{{ require_ironic_networks }}"
@ -162,7 +163,7 @@
required: "{{ require_ironic_networks }}"
require_provider_networks: >-
{{ kolla_enable_neutron | bool and
(inventory_hostname in groups['network'] or
(inventory_hostname in groups[controller_network_group] or
(kolla_enable_neutron_provider_networks | bool and inventory_hostname in groups['compute'])) }}
# This expression generates a list containing an item for each network
# in external_net_names, in the format required by the
@ -201,11 +202,11 @@
- var_name: "kolla_provision_interface"
description: "Bare metal provisioning network"
network: "{{ provision_wl_net_name }}"
required: "{{ kolla_enable_ironic | bool and inventory_hostname in groups['controllers'] }}"
required: "{{ require_ironic_networks }}"
- var_name: "kolla_inspector_dnsmasq_interface"
description: "Bare metal introspection network"
network: "{{ inspection_net_name }}"
required: "{{ kolla_enable_ironic | bool and inventory_hostname in groups['controllers'] }}"
required: "{{ require_ironic_networks }}"
- var_name: "kolla_dns_interface"
description: "DNS network"
network: "{{ public_net_name }}"
@ -217,7 +218,7 @@
- var_name: "kolla_external_vip_interface"
description: "External network"
network: "{{ public_net_name }}"
required: "{{ inventory_hostname in groups['network'] }}"
required: "{{ inventory_hostname in groups[controller_loadbalancer_group] }}"
external_networks: "{{ ironic_networks + provider_networks }}"
- import_role:

View File

@ -237,6 +237,14 @@ kolla_openstack_logging_debug:
#kolla_enable_telegraf:
#kolla_enable_watcher:
#######################
# Ironic options
#######################
# Which host to use to deploy the ironic-inspector services for ironic. By
# default this is none and all hosts in the controllers group are used instead.
kolla_ironic_inspector_host:
#######################
# Nova options
#######################

View File

@ -248,15 +248,12 @@ ironic
[ironic-conductor:children]
ironic
#[ironic-inspector:children]
#ironic
{% if kolla_ironic_inspector_host %}
[ironic-inspector]
# FIXME: Ideally we wouldn't reference controllers in here directly, but only
# one inspector service should exist, and groups can't be indexed in an
# inventory (e.g. ironic[0]).
{% if groups.get('controllers', []) | length > 0 %}
{{ groups['controllers'][0] }}
{{ kolla_ironic_inspector_host }}
{% else %}
[ironic-inspector:children]
ironic
{% endif %}
[ironic-tftp:children]

View File

@ -247,3 +247,37 @@ Next, we must configure kayobe to use this inventory template.
Here we use the ``template`` lookup plugin to render the Jinja2-formatted
inventory template.
Fine-grained placement
======================
Kayobe has fairly coarse-grained default groups - ``controller``, ``compute``,
etc, which work well in the majority of cases. Kolla Ansible allows much
more fine-grained placement on a per-service basis, e.g.
``ironic-conductor``. If the operator has taken advantage of this
fine-grained placement, then it is possible that some of the assumptions
in Kayobe may be incorrect. This is one downside of the split between
Kayobe and Kolla Ansible.
For example, Ironic conductor services may have been moved to a subset of the
top level ``controllers`` group. In this case, we would not want the Ironic
networks to be mapped to all hosts in the controllers group - only those
running Ironic conductor services. The same argument can be made if the
loadbalancer services (HAProxy & keepalived) or Neutron dataplane services
(e.g. L3 & DHCP agents) have been separated from the top level ``network``
group.
In these cases, the following variables may be used to tune placement:
``controller_ironic_conductor_group``
Ansible inventory group in which Ironic conductor services are deployed.
Default is ``controllers``.
``controller_ironic_inspector_group``
Ansible inventory group in which Ironic inspector services are deployed.
Default is ``controllers``.
``controller_loadbalancer_group``
Ansible inventory group in which control plane load balancer services are
deployed. Default is ``network``.
``controller_network_group``
Ansible inventory group in which network data plane services are deployed.
Default is ``network``.

View File

@ -6,6 +6,25 @@
# to setup the Kayobe user account. Default is {{ os_distribution }}.
#controller_bootstrap_user:
###############################################################################
# Controller groups.
# Ansible inventory group in which Ironic conductor services are deployed.
# Default is 'controllers'.
#controller_ironic_conductor_group:
# Ansible inventory group in which Ironic inspector services are deployed.
# Default is 'controllers'.
#controller_ironic_inspector_group:
# Ansible inventory group in which control plane load balancer services are
# deployed. Default is 'network'.
#controller_loadbalancer_group:
# Ansible inventory group in which network data plane services are deployed.
# Default is 'network'.
#controller_network_group:
###############################################################################
# Controller network interface configuration.

View File

@ -0,0 +1,10 @@
---
features:
- |
Adds the following variables to allow more fine-grained placement of
services:
* ``controller_ironic_conductor_group``
* ``controller_ironic_inspector_group``
* ``controller_loadbalancer_group``
* ``controller_network_group``