Skip to content

Commit

Permalink
Update nic-config samples and docs
Browse files Browse the repository at this point in the history
This change updates the nic-config samples and documentation to reflect
the changes made in:
openstack-k8s-operators/edpm-ansible#243

Signed-off-by: Brendan Shephard <[email protected]>
  • Loading branch information
bshephar committed Jul 27, 2023
1 parent 0ed4d58 commit d8bd7fc
Show file tree
Hide file tree
Showing 14 changed files with 450 additions and 98 deletions.
35 changes: 34 additions & 1 deletion config/samples/dataplane_v1beta1_openstackdataplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,40 @@ spec:
ansibleUser: root
ansiblePort: 22
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
networkConfig:
template: |
---
{% set control_virtual_ip = net_vip_map.ctlplane %}
{% set public_virtual_ip = vip_port_map.external.ip_address %}
{% if ':' in control_virtual_ip %}
{% set control_virtual_cidr = 128 %}
{% else %}
{% set control_virtual_cidr = 32 %}
{% endif %}
{% if ':' in public_virtual_ip %}
{% set public_virtual_cidr = 128 %}
{% else %}
{% set public_virtual_cidr = 32 %}
{% endif %}
network_config:
- type: ovs_bridge
name: br-ctlplane
use_dhcp: false
mtu: {{ ctlplane_mtu }}
ovs_extra:
- br-set-external-id br-ctlplane bridge-id br-ctlplane
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- ip_netmask: {{ control_virtual_ip}}/{{ control_virtual_cidr }}
- ip_netmask: {{ public_virtual_ip}}/{{ public_virtual_cidr }}
routes: {{ ctlplane_host_routes }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: {{ neutron_public_interface_name }}
primary: true
mtu: {{ ctlplane_mtu }}
ansibleVars: |
service_net_map:
nova_api_network: internal_api
Expand All @@ -62,7 +96,6 @@ spec:
# edpm_network_config
# Default nic config template for a EDPM compute node
# These vars are edpm_network_config role vars
edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2
edpm_network_config_hide_sensitive_logs: false
#
# These vars are for the network config templates themselves and are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,40 @@ spec:
ansibleUser: cloud-admin
ansiblePort: 22
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
networkConfig:
template: |
---
{% set control_virtual_ip = net_vip_map.ctlplane %}
{% set public_virtual_ip = vip_port_map.external.ip_address %}
{% if ':' in control_virtual_ip %}
{% set control_virtual_cidr = 128 %}
{% else %}
{% set control_virtual_cidr = 32 %}
{% endif %}
{% if ':' in public_virtual_ip %}
{% set public_virtual_cidr = 128 %}
{% else %}
{% set public_virtual_cidr = 32 %}
{% endif %}
network_config:
- type: ovs_bridge
name: br-ctlplane
use_dhcp: false
mtu: {{ ctlplane_mtu }}
ovs_extra:
- br-set-external-id br-ctlplane bridge-id br-ctlplane
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- ip_netmask: {{ control_virtual_ip}}/{{ control_virtual_cidr }}
- ip_netmask: {{ public_virtual_ip}}/{{ public_virtual_cidr }}
routes: {{ ctlplane_host_routes }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: {{ neutron_public_interface_name }}
primary: true
mtu: {{ ctlplane_mtu }}
ansibleVars: |
service_net_map:
nova_api_network: internal_api
Expand All @@ -62,7 +96,6 @@ spec:
# edpm_network_config
# Default nic config template for a EDPM compute node
# These vars are edpm_network_config role vars
edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2
edpm_network_config_hide_sensitive_logs: false
# These vars are for the network config templates themselves and are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,40 @@ spec:
managementNetwork: CtlPlane
ansibleUser: cloud-admin
ansiblePort: 22
networkConfig:
template: |
---
{% set control_virtual_ip = net_vip_map.ctlplane %}
{% set public_virtual_ip = vip_port_map.external.ip_address %}
{% if ':' in control_virtual_ip %}
{% set control_virtual_cidr = 128 %}
{% else %}
{% set control_virtual_cidr = 32 %}
{% endif %}
{% if ':' in public_virtual_ip %}
{% set public_virtual_cidr = 128 %}
{% else %}
{% set public_virtual_cidr = 32 %}
{% endif %}
network_config:
- type: ovs_bridge
name: br-ctlplane
use_dhcp: false
mtu: {{ ctlplane_mtu }}
ovs_extra:
- br-set-external-id br-ctlplane bridge-id br-ctlplane
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- ip_netmask: {{ control_virtual_ip}}/{{ control_virtual_cidr }}
- ip_netmask: {{ public_virtual_ip}}/{{ public_virtual_cidr }}
routes: {{ ctlplane_host_routes }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: {{ neutron_public_interface_name }}
primary: true
mtu: {{ ctlplane_mtu }}
ansibleVars: |
service_net_map:
nova_api_network: internal_api
Expand All @@ -57,7 +91,6 @@ spec:
# edpm_network_config
# Default nic config template for a EDPM compute node
# These vars are edpm_network_config role vars
edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2
edpm_network_config_hide_sensitive_logs: false
# These vars are for the network config templates themselves and are
# considered EDPM network defaults.
Expand Down
35 changes: 34 additions & 1 deletion config/samples/dataplane_v1beta1_openstackdataplane_ceph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,40 @@ spec:
ansibleUser: root
ansiblePort: 22
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
networkConfig:
template: |
---
{% set control_virtual_ip = net_vip_map.ctlplane %}
{% set public_virtual_ip = vip_port_map.external.ip_address %}
{% if ':' in control_virtual_ip %}
{% set control_virtual_cidr = 128 %}
{% else %}
{% set control_virtual_cidr = 32 %}
{% endif %}
{% if ':' in public_virtual_ip %}
{% set public_virtual_cidr = 128 %}
{% else %}
{% set public_virtual_cidr = 32 %}
{% endif %}
network_config:
- type: ovs_bridge
name: br-ctlplane
use_dhcp: false
mtu: {{ ctlplane_mtu }}
ovs_extra:
- br-set-external-id br-ctlplane bridge-id br-ctlplane
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- ip_netmask: {{ control_virtual_ip}}/{{ control_virtual_cidr }}
- ip_netmask: {{ public_virtual_ip}}/{{ public_virtual_cidr }}
routes: {{ ctlplane_host_routes }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: {{ neutron_public_interface_name }}
primary: true
mtu: {{ ctlplane_mtu }}
ansibleVars: |
service_net_map:
nova_api_network: internal_api
Expand All @@ -97,7 +131,6 @@ spec:
# edpm_network_config
# Default nic config template for a EDPM compute node
# These vars are edpm_network_config role vars
edpm_network_config_template: templates/single_nic_vlans/single_nic_vlans.j2
edpm_network_config_hide_sensitive_logs: false
#
# These vars are for the network config templates themselves and are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,55 +43,42 @@ spec:
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
networkConfig:
template: |
---
network_config:
- type: interface
name: nic2
mtu: 1500
addresses:
- ip_netmask:
{{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- type: ovs_bridge
name: {{ neutron_physical_bridge_name }}
mtu: 1500
use_dhcp: false
dns_servers: {{ ctlplane_dns_nameservers }}
domain: []
addresses:
- ip_netmask: {{ lookup('vars', networks_lower["External"] ~ '_ip') }}/{{ lookup('vars', networks_lower["External"] ~ '_cidr') }}
routes: [{'ip_netmask': '0.0.0.0/0', 'next_hop': '192.168.1.254'}]
members:
- type: interface
name: nic1
mtu: 1500
# force the MAC address of the bridge to this interface
primary: true
- type: vlan
mtu: 1500
vlan_id: 20
---
{% set control_virtual_ip = net_vip_map.ctlplane %}
{% set public_virtual_ip = vip_port_map.external.ip_address %}
{% if ':' in control_virtual_ip %}
{% set control_virtual_cidr = 128 %}
{% else %}
{% set control_virtual_cidr = 32 %}
{% endif %}
{% if ':' in public_virtual_ip %}
{% set public_virtual_cidr = 128 %}
{% else %}
{% set public_virtual_cidr = 32 %}
{% endif %}
network_config:
- type: ovs_bridge
name: br-ctlplane
use_dhcp: false
mtu: {{ ctlplane_mtu }}
ovs_extra:
- br-set-external-id br-ctlplane bridge-id br-ctlplane
addresses:
- ip_netmask:
172.17.0.101/24
routes: []
- type: vlan
mtu: 1500
vlan_id: 25
addresses:
- ip_netmask:
172.18.0.101/24
routes: []
- type: vlan
mtu: 1500
vlan_id: 22
addresses:
- ip_netmask:
172.19.0.101/24
routes: []
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- ip_netmask: {{ control_virtual_ip}}/{{ control_virtual_cidr }}
- ip_netmask: {{ public_virtual_ip}}/{{ public_virtual_cidr }}
routes: {{ ctlplane_host_routes }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: {{ neutron_public_interface_name }}
primary: true
mtu: {{ ctlplane_mtu }}
ansibleVars: |
# edpm_network_config
# Default nic config template for a EDPM compute node
# These vars are edpm_network_config role vars
edpm_network_config_template: /runner/network/nic-config-template
edpm_network_config_hide_sensitive_logs: false
edpm_network_config_update: false
#
Expand Down
34 changes: 34 additions & 0 deletions config/samples/dataplane_v1beta1_openstackdataplanenode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,37 @@ spec:
- network: ctlplane
fixedIP: 192.168.122.18
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
networkConfig:
template: |
---
{% set control_virtual_ip = net_vip_map.ctlplane %}
{% set public_virtual_ip = vip_port_map.external.ip_address %}
{% if ':' in control_virtual_ip %}
{% set control_virtual_cidr = 128 %}
{% else %}
{% set control_virtual_cidr = 32 %}
{% endif %}
{% if ':' in public_virtual_ip %}
{% set public_virtual_cidr = 128 %}
{% else %}
{% set public_virtual_cidr = 32 %}
{% endif %}
network_config:
- type: ovs_bridge
name: br-ctlplane
use_dhcp: false
mtu: {{ ctlplane_mtu }}
ovs_extra:
- br-set-external-id br-ctlplane bridge-id br-ctlplane
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- ip_netmask: {{ control_virtual_ip}}/{{ control_virtual_cidr }}
- ip_netmask: {{ public_virtual_ip}}/{{ public_virtual_cidr }}
routes: {{ ctlplane_host_routes }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: {{ neutron_public_interface_name }}
primary: true
mtu: {{ ctlplane_mtu }}
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,39 @@ spec:
ansibleVars: |
tenant_ip: 192.168.24.100
ansibleSSHPrivateKeySecret: dataplane-ansible-ssh-private-key-secret
networkConfig:
template: |
---
{% set control_virtual_ip = net_vip_map.ctlplane %}
{% set public_virtual_ip = vip_port_map.external.ip_address %}
{% if ':' in control_virtual_ip %}
{% set control_virtual_cidr = 128 %}
{% else %}
{% set control_virtual_cidr = 32 %}
{% endif %}
{% if ':' in public_virtual_ip %}
{% set public_virtual_cidr = 128 %}
{% else %}
{% set public_virtual_cidr = 32 %}
{% endif %}
network_config:
- type: ovs_bridge
name: br-ctlplane
use_dhcp: false
mtu: {{ ctlplane_mtu }}
ovs_extra:
- br-set-external-id br-ctlplane bridge-id br-ctlplane
addresses:
- ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_subnet_cidr }}
- ip_netmask: {{ control_virtual_ip}}/{{ control_virtual_cidr }}
- ip_netmask: {{ public_virtual_ip}}/{{ public_virtual_cidr }}
routes: {{ ctlplane_host_routes }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: {{ neutron_public_interface_name }}
primary: true
mtu: {{ ctlplane_mtu }}
deployStrategy:
deploy: false
Loading

0 comments on commit d8bd7fc

Please sign in to comment.