Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions config/samples/dataplane/nmstate/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,3 @@ replacements:
- spec.nodeTemplate.ansible.ansibleVars
options:
create: true

patches:
- target:
kind: OpenStackDataPlaneNodeSet
name: .*
patch: |-
- op: copy
from: /spec/nodes/edpm-compute-0
path: /spec/nodes/edpm-compute-1
- op: replace
path: /spec/nodes/edpm-compute-1/ansible/ansibleHost
value: 192.168.122.101
- op: replace
path: /spec/nodes/edpm-compute-1/hostName
value: edpm-compute-1
- op: replace
path: /spec/nodes/edpm-compute-1/networks/0/fixedIP
value: 192.168.122.101
26 changes: 20 additions & 6 deletions config/samples/dataplane/nmstate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ data:
search: {{ dns_search_domains }}
server: {{ ctlplane_dns_nameservers }}
interfaces:
- name: {{ neutron_public_interface_name }}
- name: nic1
type: ethernet
state: up
mtu: {{ min_viable_mtu }}
- name: {{ neutron_physical_bridge_name }}
type: ovs-interface
state: up
Expand All @@ -48,29 +49,42 @@ data:
{% endfor %}
- name: {{ neutron_physical_bridge_name }}
type: ovs-bridge
state: up
bridge:
options:
fail-mode: standalone
port:
- name: {{ neutron_public_interface_name }}
- name: nic1
- name: {{ neutron_physical_bridge_name }}
{% for network in nodeset_networks %}
- name: {{ "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
vlan:
mode: access
tag: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
{% endfor %}
{% set routes = [] %}
{% for route in ctlplane_host_routes | default([], true) %}
{% set _ = routes.append((route, neutron_physical_bridge_name)) %}
{% endfor %}
{% for network in nodeset_networks %}
{% for route in lookup('vars', networks_lower[network] ~ '_host_routes') | default([], true) %}
{% set _ = routes.append((route, "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id'))) %}
{% endfor %}
{% endfor %}
{% if routes %}
routes:
config:
- destination: {{ ctlplane_host_routes.ip_netmask }}
next-hop-address: {{ ctlplane_host_routes.next_hop }}
next-hop-interface: {{ neutron_physical_bridge_name }}
{% for route, iface in routes %}
- destination: {{ route.destination | default(route.ip_netmask, true) }}
next-hop-address: {{ route.nexthop | default(route.next_hop, true) }}
next-hop-interface: {{ iface }}
{% endfor %}
{% endif %}
# edpm_network_config - nmstate
edpm_network_config_tool: 'nmstate'
# 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
# edpm_nodes_validation
edpm_nodes_validation_validate_controllers_icmp: false
edpm_nodes_validation_validate_gateway_icmp: false
Expand Down
24 changes: 24 additions & 0 deletions config/samples/dataplane/nmstate_baremetal/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

namespace: openstack

components:
- ../baremetal

resources:
- values.yaml

replacements:
# OpenStackDataPlaneNodeSet customizations
- source:
kind: DataPlaneConfig
name: edpm-nmstate-baremetal-values
fieldPath: data.nodeset.nodetemplate.ansible.vars
targets:
- select:
kind: OpenStackDataPlaneNodeSet
fieldPaths:
- spec.nodeTemplate.ansible.ansibleVars
options:
create: true
100 changes: 100 additions & 0 deletions config/samples/dataplane/nmstate_baremetal/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# local-config: referenced, but not emitted by kustomize
apiVersion: v1
kind: DataPlaneConfig
metadata:
name: edpm-nmstate-baremetal-values
annotations:
config.kubernetes.io/local-config: "true"
data:
nodeset:
nodetemplate:
ansible:
vars:
edpm_network_config_hide_sensitive_logs: false
edpm_network_config_template: |
---
{% set mtu_list = [ctlplane_mtu] %}
{% for network in nodeset_networks %}
{% set _ = mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) %}
{%- endfor %}
{% set min_viable_mtu = mtu_list | max %}
dns-resolver:
config:
search: {{ dns_search_domains }}
server: {{ ctlplane_dns_nameservers }}
interfaces:
- name: nic1
type: ethernet
state: up
mtu: {{ min_viable_mtu }}
- name: {{ neutron_physical_bridge_name }}
type: ovs-interface
state: up
mtu: {{ min_viable_mtu }}
ipv4:
enabled: true
address:
- ip: {{ ctlplane_ip }}
prefix-length: {{ ctlplane_cidr }}
{% for network in nodeset_networks %}
- name: {{ "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
type: ovs-interface
state: up
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
ipv4:
enabled: true
address:
- ip: {{ lookup('vars', networks_lower[network] ~ '_ip') }}
prefix-length: {{ lookup('vars', networks_lower[network] ~ '_cidr') }}
{% endfor %}
- name: {{ neutron_physical_bridge_name }}
type: ovs-bridge
state: up
bridge:
options:
fail-mode: standalone
port:
- name: nic1
- name: {{ neutron_physical_bridge_name }}
{% for network in nodeset_networks %}
- name: {{ "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
vlan:
mode: access
tag: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
{% endfor %}
{% set routes = [] %}
{% for route in ctlplane_host_routes | default([], true) %}
{% set _ = routes.append((route, neutron_physical_bridge_name)) %}
{% endfor %}
{% for network in nodeset_networks %}
{% for route in lookup('vars', networks_lower[network] ~ '_host_routes') | default([], true) %}
{% set _ = routes.append((route, "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id'))) %}
{% endfor %}
{% endfor %}
{% if routes %}
routes:
config:
{% for route, iface in routes %}
- destination: {{ route.destination | default(route.ip_netmask, true) }}
next-hop-address: {{ route.nexthop | default(route.next_hop, true) }}
next-hop-interface: {{ iface }}
{% endfor %}
{% endif %}
# edpm_network_config - nmstate
edpm_network_config_tool: 'nmstate'
# These vars are for the network config templates themselves and are
# considered EDPM network defaults.
neutron_physical_bridge_name: br-ex
# 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: []
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.111.0/24']
# SELinux module
edpm_selinux_mode: enforcing
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
{% set mtu_list = [ctlplane_mtu] %}
{% for network in nodeset_networks %}
{% set _ = mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) %}
{%- endfor %}
{% set min_viable_mtu = mtu_list | max %}
dns-resolver:
config:
search: {{ dns_search_domains }}
server: {{ ctlplane_dns_nameservers }}
interfaces:
- name: nic1
type: ethernet
state: up
mtu: {{ min_viable_mtu }}
- name: {{ neutron_physical_bridge_name }}
type: ovs-interface
state: up
mtu: {{ min_viable_mtu }}
ipv4:
enabled: true
address:
- ip: {{ ctlplane_ip }}
prefix-length: {{ ctlplane_cidr }}
{% for network in nodeset_networks %}
- name: {{ "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
type: ovs-interface
state: up
mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }}
ipv4:
enabled: true
address:
- ip: {{ lookup('vars', networks_lower[network] ~ '_ip') }}
prefix-length: {{ lookup('vars', networks_lower[network] ~ '_cidr') }}
{% endfor %}
- name: {{ neutron_physical_bridge_name }}
type: ovs-bridge
state: up
bridge:
options:
fail-mode: standalone
port:
- name: nic1
- name: {{ neutron_physical_bridge_name }}
{% for network in nodeset_networks %}
- name: {{ "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
vlan:
mode: access
tag: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}
{% endfor %}
{% set routes = [] %}
{% for route in ctlplane_host_routes | default([], true) %}
{% set _ = routes.append((route, neutron_physical_bridge_name)) %}
{% endfor %}
{% for network in nodeset_networks %}
{% for route in lookup('vars', networks_lower[network] ~ '_host_routes') | default([], true) %}
{% set _ = routes.append((route, "vlan" ~ lookup('vars', networks_lower[network] ~ '_vlan_id'))) %}
{% endfor %}
{% endfor %}
{% if routes %}
routes:
config:
{% for route, iface in routes %}
- destination: {{ route.destination | default(route.ip_netmask, true) }}
next-hop-address: {{ route.nexthop | default(route.next_hop, true) }}
next-hop-interface: {{ iface }}
{% endfor %}
{% endif %}
Loading