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 Aug 7, 2023
1 parent 8ecd0d0 commit 1672f0a
Show file tree
Hide file tree
Showing 16 changed files with 491 additions and 77 deletions.
33 changes: 33 additions & 0 deletions config/samples/dataplane_v1beta1_openstackdataplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,39 @@ spec:
# 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 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 }}
#
# These vars are for the network config templates themselves and are
# considered EDPM network defaults.
Expand Down
34 changes: 34 additions & 0 deletions config/samples/dataplane_v1beta1_openstackdataplane_baremetal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,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 Down
34 changes: 34 additions & 0 deletions 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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,32 +43,26 @@ 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
Expand All @@ -87,6 +81,17 @@ spec:
- 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
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,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:
tenant_ip: 192.168.24.100
edpm_network_config_hide_sensitive_logs: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,39 @@ spec:
ansibleVars:
tenant_ip: 192.168.24.101
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 1672f0a

Please sign in to comment.