Skip to content

Commit

Permalink
Add support for ovn-controller and neutron-metadata-agent split
Browse files Browse the repository at this point in the history
This depends on the edpm-ansible PR that split the roles
Depends-On: openstack-k8s-operators/edpm-ansible#382
  • Loading branch information
luis5tb committed Oct 11, 2023
1 parent 155b6bd commit 5c98ac1
Show file tree
Hide file tree
Showing 25 changed files with 257 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,7 @@ spec:
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
- telemetry
Expand Down
18 changes: 9 additions & 9 deletions api/v1beta1/openstackdataplanenodeset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type OpenStackDataPlaneNodeSetSpec struct {
NetworkAttachments []string `json:"networkAttachments,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default={download-cache,configure-network,validate-network,install-os,configure-os,run-os,ovn,libvirt,nova,telemetry}
// +kubebuilder:default={download-cache,configure-network,validate-network,install-os,configure-os,run-os,ovn,neutron-metadata,libvirt,nova,telemetry}
// Services list
Services []string `json:"services"`
}
Expand Down Expand Up @@ -145,12 +145,12 @@ func (instance OpenStackDataPlaneNodeSet) GetAnsibleEESpec() AnsibleEESpec {

// DataplaneAnsibleImageDefaults default images for dataplane services
type DataplaneAnsibleImageDefaults struct {
Frr string
IscsiD string
Logrotate string
NovaCompute string
NovaLibvirt string
OvnControllerAgent string
OvnMetadataAgent string
OvnBgpAgent string
Frr string
IscsiD string
Logrotate string
NeutronMetadataAgent string
NovaCompute string
NovaLibvirt string
OvnControllerAgent string
OvnBgpAgent string
}
Original file line number Diff line number Diff line change
Expand Up @@ -1868,6 +1868,7 @@ spec:
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
- telemetry
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_default_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
value: quay.io/podified-antelope-centos9/openstack-nova-libvirt:current-podified
- name: RELATED_IMAGE_OPENSTACK_EDPM_OVN_CONTROLLER_AGENT_DEFAULT_IMG
value: quay.io/podified-antelope-centos9/openstack-ovn-controller:current-podified
- name: RELATED_IMAGE_OPENSTACK_EDPM_OVN_METADATA_AGENT_DEFAULT_IMG
- name: RELATED_IMAGE_OPENSTACK_EDPM_NEUTRON_METADATA_AGENT_DEFAULT_IMG
value: quay.io/podified-antelope-centos9/openstack-neutron-metadata-agent-ovn:current-podified
- name: RELATED_IMAGE_OPENSTACK_EDPM_OVN_BGP_AGENT_IMAGE
value: quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
- telemetry
Expand Down Expand Up @@ -130,7 +131,7 @@ spec:
edpm_logrotate_crond_image: "{{ registry_url }}/openstack-cron:{{ image_tag }}"
edpm_nova_compute_container_image: "{{ registry_url }}/openstack-nova-compute:{{ image_tag }}"
edpm_nova_libvirt_container_image: "{{ registry_url }}/openstack-nova-libvirt:{{ image_tag }}"
edpm_ovn_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"
edpm_neutron_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"
gather_facts: false
enable_debug: false
# edpm firewall, change the allowed CIDR if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
- telemetry
Expand Down Expand Up @@ -152,7 +153,7 @@ spec:
edpm_logrotate_crond_image: "{{ registry_url }}/openstack-cron:{{ image_tag }}"
edpm_nova_compute_container_image: "{{ registry_url }}/openstack-nova-compute:{{ image_tag }}"
edpm_nova_libvirt_container_image: "{{ registry_url }}/openstack-nova-libvirt:{{ image_tag }}"
edpm_ovn_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"
edpm_neutron_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"

gather_facts: false
enable_debug: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
- telemetry
Expand Down Expand Up @@ -110,7 +111,7 @@ spec:
edpm_logrotate_crond_image: "{{ registry_url }}/openstack-cron:{{ image_tag }}"
edpm_nova_compute_container_image: "{{ registry_url }}/openstack-nova-compute:{{ image_tag }}"
edpm_nova_libvirt_container_image: "{{ registry_url }}/openstack-nova-libvirt:{{ image_tag }}"
edpm_ovn_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"
edpm_neutron_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"
gather_facts: false
enable_debug: false
# edpm firewall, change the allowed CIDR if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,6 @@ spec:
- run-os
- ceph-client
- ovn
- neutron-metadata
- libvirt
- nova-custom-ceph
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ spec:
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
- telemetry
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneNodeSet
metadata:
name: openstack-edpm
spec:
env:
- name: ANSIBLE_FORCE_COLOR
value: "True"
- name: ANSIBLE_ENABLE_TASK_DEBUGGER
value: "True"
services:
- download-cache
- configure-network
- validate-network
- install-os
- configure-os
- run-os
- ovn
- telemetry
preProvisioned: true
nodes:
edpm-compute-0:
hostName: edpm-compute-0
ansible:
ansibleHost: 192.168.122.100
ansibleVars:
ctlplane_ip: 192.168.122.100
internal_api_ip: 172.17.0.100
storage_ip: 172.18.0.100
tenant_ip: 172.19.0.100
fqdn_internal_api: edpm-compute-0.example.com
networkAttachments:
- ctlplane
nodeTemplate:
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
managementNetwork: ctlplane
ansible:
ansibleUser: cloud-admin
ansiblePort: 22
ansibleVars:
service_net_map:
nova_api_network: internal_api
nova_libvirt_network: internal_api
edpm_chrony_ntp_servers:
- pool.ntp.org
# edpm_network_config
# Default nic config template for a EDPM compute node
# These vars are edpm_network_config role vars
edpm_network_config_hide_sensitive_logs: false
edpm_network_config_template: |
---
{% set mtu_list = [ctlplane_mtu] %}
{% for network in role_networks %}
{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }}
{%- endfor %}
{% set min_viable_mtu = mtu_list | max %}
network_config:
- type: ovs_bridge
name: {{ neutron_physical_bridge_name }}
mtu: {{ min_viable_mtu }}
use_dhcp: false
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
routes: {{ ctlplane_host_routes }}
members:
- type: interface
name: nic1
mtu: {{ min_viable_mtu }}
# force the MAC address of the bridge to this interface
primary: true
{% for network in role_networks %}
- type: vlan
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
addresses:
- ip_netmask:
{{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
{% endfor %}
# These vars are for the network config templates themselves and are
# considered EDPM network defaults.
neutron_physical_bridge_name: br-ex
neutron_public_interface_name: eth0
ctlplane_mtu: 1500
ctlplane_subnet_cidr: 24
ctlplane_gateway_ip: 192.168.122.1
ctlplane_host_routes:
- ip_netmask: 0.0.0.0/0
next_hop: 192.168.122.1
external_mtu: 1500
external_vlan_id: 44
external_cidr: '24'
external_host_routes: []
internal_api_mtu: 1500
internal_api_vlan_id: 20
internal_api_cidr: '24'
internal_api_host_routes: []
storage_mtu: 1500
storage_vlan_id: 21
storage_cidr: '24'
storage_host_routes: []
tenant_mtu: 1500
tenant_vlan_id: 22
tenant_cidr: '24'
tenant_host_routes: []
role_networks:
- InternalApi
- Storage
- Tenant
networks_lower:
External: external
InternalApi: internal_api
Storage: storage
Tenant: tenant
# edpm_nodes_validation
edpm_nodes_validation_validate_controllers_icmp: false
edpm_nodes_validation_validate_gateway_icmp: false
ctlplane_dns_nameservers:
- 192.168.122.1
dns_search_domains: []
registry_url: quay.io/podified-antelope-centos9
image_tag: current-podified
edpm_ovn_controller_agent_image: "{{ registry_url }}/openstack-ovn-controller:{{ image_tag }}"
edpm_iscsid_image: "{{ registry_url }}/openstack-iscsid:{{ image_tag }}"
edpm_logrotate_crond_image: "{{ registry_url }}/openstack-cron:{{ image_tag }}"
edpm_enable_chassis_gw: true
gather_facts: false
enable_debug: false
# edpm firewall, change the allowed CIDR if needed
edpm_sshd_configure_firewall: true
edpm_sshd_allowed_ranges: ['192.168.122.0/24']
# SELinux module
edpm_selinux_mode: enforcing
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
- telemetry
Expand Down Expand Up @@ -123,7 +124,7 @@ spec:
edpm_logrotate_crond_image: "{{ registry_url }}/openstack-cron:{{ image_tag }}"
edpm_nova_compute_container_image: "{{ registry_url }}/openstack-nova-compute:{{ image_tag }}"
edpm_nova_libvirt_container_image: "{{ registry_url }}/openstack-nova-libvirt:{{ image_tag }}"
edpm_ovn_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"
edpm_neutron_metadata_agent_image: "{{ registry_url }}/openstack-neutron-metadata-agent-ovn:{{ image_tag }}"
gather_facts: false
enable_debug: false
# edpm firewall, change the allowed CIDR if needed
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneService
metadata:
name: neutron-metadata
spec:
label: dataplane-deployment-neutron-metadata
playbook: osp.edpm.neutron_metadata
secrets:
- neutron-ovn-metadata-agent-neutron-config
- nova-metadata-neutron-config
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ spec:
playbook: osp.edpm.ovn
configMaps:
- ovncontroller-config
secrets:
- neutron-ovn-metadata-agent-neutron-config
- nova-metadata-neutron-config
20 changes: 10 additions & 10 deletions controllers/openstackdataplanenodeset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,29 @@ const (
IscsiDDefaultImage = "quay.io/podified-antelope-centos9/openstack-iscsid:current-podified"
// LogrotateDefaultImage -
LogrotateDefaultImage = "quay.io/podified-antelope-centos9/openstack-cron:current-podified"
// NeutronMetadataAgentDefaultImage -
NeutronMetadataAgentDefaultImage = "quay.io/podified-antelope-centos9/openstack-neutron-metadata-agent-ovn:current-podified"
// NovaComputeDefaultImage -
NovaComputeDefaultImage = "quay.io/podified-antelope-centos9/openstack-nova-compute:current-podified"
// NovaLibvirtDefaultImage -
NovaLibvirtDefaultImage = "quay.io/podified-antelope-centos9/openstack-nova-libvirt:current-podified"
// OvnControllerAgentDefaultImage -
OvnControllerAgentDefaultImage = "quay.io/podified-antelope-centos9/openstack-ovn-controller:current-podified"
// OvnMetadataAgentDefaultImage -
OvnMetadataAgentDefaultImage = "quay.io/podified-antelope-centos9/openstack-neutron-metadata-agent-ovn:current-podified"
// OvnBgpAgentDefaultImage -
OvnBgpAgentDefaultImage = "quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified"
)

// SetupAnsibleImageDefaults -
func SetupAnsibleImageDefaults() {
dataplaneAnsibleImageDefaults = dataplanev1.DataplaneAnsibleImageDefaults{
Frr: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_FRR_DEFAULT_IMG", FrrDefaultImage),
IscsiD: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_ISCSID_DEFAULT_IMG", IscsiDDefaultImage),
Logrotate: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_LOGROTATE_CROND_DEFAULT_IMG", LogrotateDefaultImage),
NovaCompute: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_NOVA_COMPUTE_DEFAULT_IMG", NovaComputeDefaultImage),
NovaLibvirt: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_NOVA_LIBVIRT_DEFAULT_IMG", NovaLibvirtDefaultImage),
OvnControllerAgent: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_OVN_CONTROLLER_AGENT_DEFAULT_IMG", OvnControllerAgentDefaultImage),
OvnMetadataAgent: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_OVN_METADATA_AGENT_DEFAULT_IMG", OvnMetadataAgentDefaultImage),
OvnBgpAgent: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_OVN_BGP_AGENT_IMAGE", OvnBgpAgentDefaultImage),
Frr: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_FRR_DEFAULT_IMG", FrrDefaultImage),
IscsiD: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_ISCSID_DEFAULT_IMG", IscsiDDefaultImage),
Logrotate: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_LOGROTATE_CROND_DEFAULT_IMG", LogrotateDefaultImage),
NeutronMetadataAgent: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_NEUTRON_METADATA_AGENT_DEFAULT_IMG", NeutronMetadataAgentDefaultImage),
NovaCompute: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_NOVA_COMPUTE_DEFAULT_IMG", NovaComputeDefaultImage),
NovaLibvirt: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_NOVA_LIBVIRT_DEFAULT_IMG", NovaLibvirtDefaultImage),
OvnControllerAgent: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_OVN_CONTROLLER_AGENT_DEFAULT_IMG", OvnControllerAgentDefaultImage),
OvnBgpAgent: util.GetEnvVar("RELATED_IMAGE_OPENSTACK_EDPM_OVN_BGP_AGENT_IMAGE", OvnBgpAgentDefaultImage),
}
}

Expand Down
10 changes: 10 additions & 0 deletions docs/composable_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The default list of services as they will appear on the `services` field on an
- libvirt
- nova
- ovn
- neutron-metadata

If the `services` field is omitted from the `OpenStackDataPlaneNodeSet` spec,
then the above list will be used.
Expand Down Expand Up @@ -72,6 +73,13 @@ configuration. For more information see the
services:
- ceph-hci-pre

### neutron-metadata

Include this service to run Neutron OVN Metadata agent on the EDPM nodes. This agent is needed to provide metadata services to the compute nodes.

services:
- neutron-metadata

### neutron-dhcp

Include this service to run Neutron DHCP agent on the EDPM nodes. This agent is needed in some cases not supported by the native OVN DHCP implementation.
Expand Down Expand Up @@ -118,6 +126,7 @@ returned.
libvirt 8d
nova 8d
ovn 8d
neutron-metadata 8d

A service can be examined in more detail by looking at the YAML representation
of the resource.
Expand Down Expand Up @@ -287,6 +296,7 @@ service to execute for the `edpm-compute` `NodeSet`.
- configure-os
- run-os
- ovn
- neutron-metadata
- libvirt
- nova
nodes:
Expand Down
1 change: 1 addition & 0 deletions docs/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ The output should be similar to:
run-os 6d6h
validate-network 6d6h
ovn 6d6h
neutron-metadata 6d6h
libvirt 6d6h
nova 6d6h
telemetry 6d6h
Expand Down
2 changes: 1 addition & 1 deletion docs/openstack_dataplanenodeset.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ DataplaneAnsibleImageDefaults default images for dataplane services
| Frr | | string | false |
| IscsiD | | string | false |
| Logrotate | | string | false |
| NeutronMetadataAgent | | string | false |
| NovaCompute | | string | false |
| NovaLibvirt | | string | false |
| OvnControllerAgent | | string | false |
| OvnMetadataAgent | | string | false |
| OvnBgpAgent | | string | false |

[Back to Custom Resources](#custom-resources)
Expand Down
Loading

0 comments on commit 5c98ac1

Please sign in to comment.