Skip to content

Commit

Permalink
Merge pull request #999 from noironetworks/chained_mode_global_vlan_c…
Browse files Browse the repository at this point in the history
…hanges

Added use_global_scope_vlan knob for global scope vlan support
  • Loading branch information
snaiksat authored Aug 2, 2023
2 parents 148ccdc + d22dbc0 commit 54522e1
Show file tree
Hide file tree
Showing 21 changed files with 2,684 additions and 47 deletions.
3 changes: 2 additions & 1 deletion provision/acc_provision/acc_provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def config_default():
"enable": False,
"primary_cni_path": "/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf",
"skip_node_network_provisioning": False,
"use_global_scope_vlan": False,
}
}
return default_config
Expand Down Expand Up @@ -501,7 +502,7 @@ def config_adjust_chained_mode(args, config, no_random):
}
}

if not config["user_config"]["chained_cni_config"]["skip_node_network_provisioning"]:
if not config["chained_cni_config"]["skip_node_network_provisioning"]:
node_subnet = config["net_config"]["node_subnet"][0]
config["net_config"]["node_subnet"] = node_subnet

Expand Down
14 changes: 8 additions & 6 deletions provision/acc_provision/templates/acc-provision-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ data:
{% if config.user_config.aci_config.secondary_aep %}
"secondary_aep": {{config.aci_config.secondary_aep|json}},
{% endif %}
{% if (config.user_config.chained_cni_config) and config.user_config.aci_config.physical_domain %}
{% if (config.user_config.chained_cni_config) and (config.user_config.aci_config.physical_domain) %}
"physical_domain": {
"domain": {{config.aci_config.physical_domain.domain|json}},
"vlan_pool": {{config.aci_config.physical_domain.vlan_pool|json}}
Expand Down Expand Up @@ -94,15 +94,14 @@ data:
},
{% elif (config.user_config.aci_config.vmm_domain) %}
}
}{% if (config.user_config.aci_config.l3out) %},
{% endif %}
},
{% endif %}
{% if((config.user_config.chained_cni_config) and (config.user_config.aci_config.l3out)) %}
{% if config.user_config.aci_config.l3out %}
"l3out": {
"name": {{config.aci_config.l3out.name|json}},
"external_networks": {{ config.aci_config.l3out.external_networks|json|indent(width=20) }}
}
{% else %}
{% elif not config.user_config.chained_cni_config %}
"l3out": {
"name": {{config.aci_config.l3out.name|json}},
"external_networks": {{ config.aci_config.l3out.external_networks|json|indent(width=20) }}
Expand Down Expand Up @@ -190,10 +189,13 @@ data:
{% if config.user_config.chained_cni_config %}
"chained_cni_config": {
"enable": {{config.chained_cni_config.enable|json}},
"primary_cni_path": {{config.chained_cni_config.primary_cni_path|json}},
{% if config.user_config.chained_cni_config.skip_node_network_provisioning %}
"skip_node_network_provisioning": {{config.chained_cni_config.skip_node_network_provisioning|json}},
{% endif %}
{% if config.user_config.chained_cni_config.use_global_scope_vlan %}
"use_global_scope_vlan": {{config.chained_cni_config.use_global_scope_vlan|json}},
{% endif %}
"primary_cni_path": {{config.chained_cni_config.primary_cni_path|json}}
},
{% endif %}
"net_config": {
Expand Down
10 changes: 10 additions & 0 deletions provision/acc_provision/templates/aci-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,11 @@ data:
"aci-vmm-controller": {{config.aci_config.vmm_domain.controller|json}},
{% endif %}
"aci-additional-vlans": {{ config.net_config.secondary_vlans|json|indent(width=8) }},
{% if config.chained_cni_config.use_global_scope_vlan %}
"aci-use-global-scope-vlan": true,
{% else %}
"aci-use-global-scope-vlan": false,
{% endif %}
"aci-policy-tenant": {{config.kube_config.default_endpoint_group.tenant|json}},
{% if config.kube_config.hpp_optimization %}
"hpp-optimization": {{ config.kube_config.hpp_optimization|json }},
Expand Down Expand Up @@ -1549,6 +1554,11 @@ data:
"interface-mtu-headroom": {{ config.net_config.interface_mtu_headroom|json }},
{% endif %}
"aci-additional-vlans": {{ config.net_config.secondary_vlans|json|indent(width=8) }},
{% if config.chained_cni_config.use_global_scope_vlan %}
"aci-use-global-scope-vlan": true,
{% else %}
"aci-use-global-scope-vlan": false,
{% endif %}
{% if config.drop_log_config.enable %}
"enable-drop-log": true,
{% else %}
Expand Down
20 changes: 16 additions & 4 deletions provision/acc_provision/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,13 +756,13 @@ def test_preexisting_tenant_chained_mode():


@in_testdir
def test_chained_mode_skip_node_network_provision():
def test_override_skip_node_network_provision():
run_provision(
"chained_mode_skip_node_network_provision.inp.yaml",
"chained_mode_skip_node_network_provision.kube.yaml",
"override_skip_node_network_provision.inp.yaml",
"override_skip_node_network_provision.kube.yaml",
None,
None,
"chained_mode_skip_node_network_provision.apic.txt",
"override_skip_node_network_provision.apic.txt",
overrides={"flavor": "openshift-sdn-ovn-baremetal"}
)

Expand Down Expand Up @@ -791,6 +791,18 @@ def test_chained_mode_without_phys_domains():
)


@in_testdir
def test_override_use_global_scope_vlan():
run_provision(
"override_use_global_scope_vlan.inp.yaml",
"override_use_global_scope_vlan.kube.yaml",
None,
None,
"override_use_global_scope_vlan.apic.txt",
overrides={"flavor": "openshift-sdn-ovn-baremetal"}
)


@in_testdir
def test_flavor_openshift_411_baremetal():
run_provision(
Expand Down
3 changes: 1 addition & 2 deletions provision/testdata/chained_mode_without_l3out.inp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ net_config:

chained_cni_config:
enable: true
primary_cni_path: "/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf"
skip_node_network_provisioning: false
primary_cni_path: "/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf"
11 changes: 5 additions & 6 deletions provision/testdata/chained_mode_without_l3out.kube.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ net_config:

chained_cni_config:
enable: true
primary_cni_path: "/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf"
skip_node_network_provisioning: false
primary_cni_path: "/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ net_config:

chained_cni_config:
enable: true
primary_cni_path: "/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf"
skip_node_network_provisioning: false
primary_cni_path: "/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf"

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data:
\ \"external_networks\": [\n \"default\"\n \
\ ]\n }\n },\n \"chained_cni_config\": {\n \
\ \"enable\": true,\n \"primary_cni_path\": \"/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf\"\
,\n },\n \"net_config\": {\n \"kubeapi_vlan\": 4001,\n\
\n },\n \"net_config\": {\n \"kubeapi_vlan\": 4001,\n\
\ \"node_subnet\": \"10.1.0.1/16\",\n \"secondary_vlans\"\
: \"[4002, 4003, 4009, 4004-4007]\",\n }\n }\n }"
kind: ConfigMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ data:
\ \"apic-private-key-path\": \"/usr/local/etc/aci-cert/user.key\",\n \"\
aci-prefix\": \"kube\",\n \"aci-vmm-type\": \"Kubernetes\",\n \"aci-vmm-domain\"\
: \"kube\",\n \"aci-vmm-controller\": \"kube\",\n \"aci-additional-vlans\"\
: \"[4002, 4003, 4009, 4004-4007]\",\n \"aci-policy-tenant\": \"kube\",\n \
\ \"aci-nodebd-dn\": \"uni/tn-kube/BD-netop-nodes\",\n \"aci-service-phys-dom\"\
: \"kube-physdom\",\n \"aci-service-encap\": \"vlan-None\",\n \"aci-pbr-tracking-non-snat\"\
: false,\n \"aci-vrf-tenant\": \"common\",\n \"aci-vrf-dn\": \"uni/tn-common/ctx-kube\"\
,\n \"aci-vrf\": \"kube\",\n \"aci-l3out\": \"l3out\",\n \"aci-ext-networks\"\
: [\n \"default\"\n ]\n}"
: \"[4002, 4003, 4009, 4004-4007]\",\n \"aci-use-global-scope-vlan\": false,\n\
\ \"aci-policy-tenant\": \"kube\",\n \"aci-nodebd-dn\": \"uni/tn-kube/BD-netop-nodes\"\
,\n \"aci-service-phys-dom\": \"kube-physdom\",\n \"aci-service-encap\"\
: \"vlan-None\",\n \"aci-pbr-tracking-non-snat\": false,\n \"aci-vrf-tenant\"\
: \"common\",\n \"aci-vrf-dn\": \"uni/tn-common/ctx-kube\",\n \"aci-vrf\"\
: \"kube\",\n \"aci-l3out\": \"l3out\",\n \"aci-ext-networks\": [\n \
\ \"default\"\n ]\n}"
host-agent-config: "{\n \"flavor\": \"openshift-sdn-ovn-baremetal\",\n \"\
app-profile\": \"netop-kube\",\n \"chained-mode\": true,\n \"primary-cni-path\"\
: \"/mnt/cni-conf/cni/net.d/10-ovn-kubernetes.conf\",\n \"log-level\": \"info\"\
,\n \"aci-vmm-type\": \"Kubernetes\",\n \"aci-vmm-domain\": \"kube\",\n\
\ \"aci-vmm-controller\": \"kube\",\n \"aci-vrf\": \"kube\",\n \"aci-vrf-tenant\"\
: \"common\",\n \"aci-prefix\": \"kube\",\n \"kubeapi-vlan\": 4001,\n \
\ \"node-subnet\": \"10.1.0.1/16\",\n \"aci-additional-vlans\": \"[4002, 4003,\
\ 4009, 4004-4007]\",\n \"enable-drop-log\": true,\n \"enable-nodepodif\"\
: false\n}"
\ 4009, 4004-4007]\",\n \"aci-use-global-scope-vlan\": false,\n \"enable-drop-log\"\
: true,\n \"enable-nodepodif\": false\n}"
kind: ConfigMap
metadata:
labels:
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 54522e1

Please sign in to comment.