Skip to content

Commit 8f9797f

Browse files
jcaamanotssurya
authored andcommitted
e2e: run shard-conformance advertising default network
Signed-off-by: Jaime Caamaño Ruiz <[email protected]> (cherry picked from commit c118a9fa321b86540e086c184254457bdb857a8a)
1 parent 95b6ca5 commit 8f9797f

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ jobs:
414414
include:
415415
- {"target": "shard-conformance", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled"}
416416
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "local", "ipfamily": "dualstack", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
417+
- {"target": "shard-conformance", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones", "routeadvertisements": "advertise-default"}
418+
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "local", "ipfamily": "dualstack", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones", "routeadvertisements": "advertise-default"}
417419
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv6", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
418420
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
419421
- {"target": "control-plane", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv6", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-disabled", "dns-name-resolver": "enable-dns-name-resolver"}
@@ -458,7 +460,7 @@ jobs:
458460
OVN_SECOND_BRIDGE: "${{ matrix.second-bridge == '2br' }}"
459461
KIND_IPV4_SUPPORT: "${{ matrix.ipfamily == 'IPv4' || matrix.ipfamily == 'dualstack' }}"
460462
KIND_IPV6_SUPPORT: "${{ matrix.ipfamily == 'IPv6' || matrix.ipfamily == 'dualstack' }}"
461-
ENABLE_MULTI_NET: "${{ matrix.target == 'multi-homing' || matrix.target == 'kv-live-migration' || matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'multi-homing-helm' || matrix.target == 'traffic-flow-test-only' }}"
463+
ENABLE_MULTI_NET: "${{ matrix.target == 'multi-homing' || matrix.target == 'kv-live-migration' || matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'multi-homing-helm' || matrix.target == 'traffic-flow-test-only' || matrix.routeadvertisements != '' }}"
462464
ENABLE_NETWORK_SEGMENTATION: "${{ matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'kv-live-migration' || matrix.target == 'traffic-flow-test-only' }}"
463465
DISABLE_UDN_HOST_ISOLATION: "true"
464466
KIND_INSTALL_KUBEVIRT: "${{ matrix.target == 'kv-live-migration' }}"
@@ -471,6 +473,8 @@ jobs:
471473
USE_HELM: "${{ matrix.target == 'control-plane-helm' || matrix.target == 'multi-homing-helm' }}"
472474
OVN_ENABLE_DNSNAMERESOLVER: "${{ matrix.dns-name-resolver == 'enable-dns-name-resolver' }}"
473475
TRAFFIC_FLOW_TESTS: "${{ matrix.traffic-flow-tests }}"
476+
ENABLE_ROUTE_ADVERTISEMENTS: "${{ matrix.routeadvertisements != '' }}"
477+
ADVERTISE_DEFAULT_NETWORK: "${{ matrix.routeadvertisements == 'advertise-default' }}"
474478
steps:
475479

476480
- name: Install VRF kernel module

contrib/kind.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ usage() {
7878
echo " [-cm | --compact-mode]"
7979
echo " [-ic | --enable-interconnect]"
8080
echo " [-rae | --enable-route-advertisements]"
81+
echo " [-adv | --advertise-default-network]"
8182
echo " [--isolated]"
8283
echo " [-dns | --enable-dnsnameresolver]"
8384
echo " [-obs | --observability]"
@@ -147,6 +148,7 @@ usage() {
147148
echo "-dns | --enable-dnsnameresolver Enable DNSNameResolver for resolving the DNS names used in the DNS rules of EgressFirewall."
148149
echo "-obs | --observability Enable OVN Observability feature."
149150
echo "-rae | --enable-route-advertisements Enable route advertisements"
151+
echo "-adv | --advertise-default-network Applies a RouteAdvertisements configuration to advertise the default network on all nodes"
150152
echo ""
151153
}
152154

@@ -332,6 +334,8 @@ parse_args() {
332334
;;
333335
-rae | --route-advertisements-enable) ENABLE_ROUTE_ADVERTISEMENTS=true
334336
;;
337+
-adv | --advertise-default-network) ADVERTISE_DEFAULT_NETWORK=true
338+
;;
335339
-ic | --enable-interconnect ) OVN_ENABLE_INTERCONNECT=true
336340
;;
337341
--disable-ovnkube-identity) OVN_ENABLE_OVNKUBE_IDENTITY=false
@@ -422,6 +426,7 @@ print_params() {
422426
echo "ENABLE_MULTI_NET = $ENABLE_MULTI_NET"
423427
echo "ENABLE_NETWORK_SEGMENTATION= $ENABLE_NETWORK_SEGMENTATION"
424428
echo "ENABLE_ROUTE_ADVERTISEMENTS= $ENABLE_ROUTE_ADVERTISEMENTS"
429+
echo "ADVERTISE_DEFAULT_NETWORK = $ADVERTISE_DEFAULT_NETWORK"
425430
echo "OVN_ENABLE_INTERCONNECT = $OVN_ENABLE_INTERCONNECT"
426431
if [ "$OVN_ENABLE_INTERCONNECT" == true ]; then
427432
echo "KIND_NUM_NODES_PER_ZONE = $KIND_NUM_NODES_PER_ZONE"
@@ -634,6 +639,7 @@ set_default_params() {
634639
echo "Route advertisements requires interconnect to be enabled (-ic)"
635640
exit 1
636641
fi
642+
ADVERTISE_DEFAULT_NETWORK=${ADVERTISE_DEFAULT_NETWORK:-false}
637643
OVN_COMPACT_MODE=${OVN_COMPACT_MODE:-false}
638644
if [ "$OVN_COMPACT_MODE" == true ]; then
639645
KIND_NUM_WORKER=0
@@ -875,6 +881,7 @@ create_ovn_kube_manifests() {
875881
--multi-network-enable="${ENABLE_MULTI_NET}" \
876882
--network-segmentation-enable="${ENABLE_NETWORK_SEGMENTATION}" \
877883
--route-advertisements-enable="${ENABLE_ROUTE_ADVERTISEMENTS}" \
884+
--advertise-default-network="${ADVERTISE_DEFAULT_NETWORK}" \
878885
--ovnkube-metrics-scale-enable="${OVN_METRICS_SCALE_ENABLE}" \
879886
--compact-mode="${OVN_COMPACT_MODE}" \
880887
--enable-interconnect="${OVN_ENABLE_INTERCONNECT}" \

dist/images/daemonset.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ OVN_DISABLE_OVN_IFACE_ID_VER="false"
7272
OVN_MULTI_NETWORK_ENABLE=
7373
OVN_NETWORK_SEGMENTATION_ENABLE=
7474
OVN_ROUTE_ADVERTISEMENTS_ENABLE=
75+
OVN_ADVERTISE_DEFAULT_NETWORK=
7576
OVN_V4_JOIN_SUBNET=""
7677
OVN_V6_JOIN_SUBNET=""
7778
OVN_V4_MASQUERADE_SUBNET=""
@@ -274,6 +275,9 @@ while [ "$1" != "" ]; do
274275
--route-advertisements-enable)
275276
OVN_ROUTE_ADVERTISEMENTS_ENABLE=$VALUE
276277
;;
278+
--advertise-default-network)
279+
OVN_ADVERTISE_DEFAULT_NETWORK=$VALUE
280+
;;
277281
--egress-service-enable)
278282
OVN_EGRESSSERVICE_ENABLE=$VALUE
279283
;;
@@ -462,6 +466,8 @@ ovn_network_segmentation_enable=${OVN_NETWORK_SEGMENTATION_ENABLE}
462466
echo "ovn_network_segmentation_enable: ${ovn_network_segmentation_enable}"
463467
ovn_route_advertisements_enable=${OVN_ROUTE_ADVERTISEMENTS_ENABLE}
464468
echo "ovn_route_advertisements_enable: ${ovn_route_advertisements_enable}"
469+
ovn_advertise_default_network=${OVN_ADVERTISE_DEFAULT_NETWORK}
470+
echo "ovn_advertise_default_network: ${ovn_advertise_default_network}"
465471
ovn_hybrid_overlay_net_cidr=${OVN_HYBRID_OVERLAY_NET_CIDR}
466472
echo "ovn_hybrid_overlay_net_cidr: ${ovn_hybrid_overlay_net_cidr}"
467473
ovn_disable_snat_multiple_gws=${OVN_DISABLE_SNAT_MULTIPLE_GWS}
@@ -1028,6 +1034,7 @@ net_cidr=${net_cidr} svc_cidr=${svc_cidr} \
10281034
mtu_value=${mtu} k8s_apiserver=${k8s_apiserver} \
10291035
host_network_namespace=${host_network_namespace} \
10301036
in_upgrade=${in_upgrade} \
1037+
advertise_default_network=${ovn_advertise_default_network} \
10311038
jinjanate ../templates/ovn-setup.yaml.j2 -o ${output_dir}/ovn-setup.yaml
10321039

10331040
ovn_enable_interconnect=${ovn_enable_interconnect} \

dist/templates/ovn-setup.yaml.j2

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,17 @@ kind: Namespace
7878
metadata:
7979
name: "{{ host_network_namespace }}"
8080
{%- endif %}
81+
82+
{% if advertise_default_network == "true" -%}
83+
---
84+
apiVersion: k8s.ovn.org/v1
85+
kind: RouteAdvertisements
86+
metadata:
87+
name: default
88+
spec:
89+
networkSelector:
90+
matchLabels:
91+
k8s.ovn.org/default-network: ""
92+
advertisements:
93+
- "PodNetwork"
94+
{%- endif %}

0 commit comments

Comments
 (0)