Skip to content

Commit

Permalink
e2e: run shard-conformance advertising default network
Browse files Browse the repository at this point in the history
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@redhat.com>
  • Loading branch information
jcaamano committed Oct 25, 2024
1 parent eb557ce commit 267985c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ jobs:
include:
- {"target": "shard-conformance", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "local", "ipfamily": "dualstack", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"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"}
- {"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"}
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv6", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "shard-conformance", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"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"}
Expand Down Expand Up @@ -450,7 +452,7 @@ jobs:
OVN_SECOND_BRIDGE: "${{ matrix.second-bridge == '2br' }}"
KIND_IPV4_SUPPORT: "${{ matrix.ipfamily == 'IPv4' || matrix.ipfamily == 'dualstack' }}"
KIND_IPV6_SUPPORT: "${{ matrix.ipfamily == 'IPv6' || matrix.ipfamily == 'dualstack' }}"
ENABLE_MULTI_NET: "${{ matrix.target == 'multi-homing' || matrix.target == 'kv-live-migration' || matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'multi-homing-helm' }}"
ENABLE_MULTI_NET: "${{ matrix.routeadvertisements != '' || matrix.target == 'multi-homing' || matrix.target == 'kv-live-migration' || matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'multi-homing-helm' }}"
ENABLE_NETWORK_SEGMENTATION: "${{ matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'kv-live-migration'}}"
KIND_INSTALL_KUBEVIRT: "${{ matrix.target == 'kv-live-migration' }}"
OVN_COMPACT_MODE: "${{ matrix.target == 'compact-mode' }}"
Expand All @@ -461,6 +463,8 @@ jobs:
OVN_DISABLE_FORWARDING: "${{ matrix.forwarding == 'disable-forwarding' }}"
USE_HELM: "${{ matrix.target == 'control-plane-helm' || matrix.target == 'multi-homing-helm' }}"
OVN_ENABLE_DNSNAMERESOLVER: "${{ matrix.dns-name-resolver == 'enable-dns-name-resolver' }}"
ENABLE_ROUTE_ADVERTISEMENTS: "${{ matrix.routeadvertisements != '' }}"
ADVERTISE_DEFAULT_NETWORK: "${{ matrix.routeadvertisements == 'advertise-default' }}"
steps:

- name: Install VRF kernel module
Expand Down
7 changes: 7 additions & 0 deletions contrib/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ usage() {
echo " [-cm | --compact-mode]"
echo " [-ic | --enable-interconnect]"
echo " [-rae | --enable-route-advertisements]"
echo " [-adv | --advertise-default-network]"
echo " [--isolated]"
echo " [-dns | --enable-dnsnameresolver]"
echo " [-obs | --observability]"
Expand Down Expand Up @@ -145,6 +146,7 @@ usage() {
echo "-dns | --enable-dnsnameresolver Enable DNSNameResolver for resolving the DNS names used in the DNS rules of EgressFirewall."
echo "-obs | --observability Enable OVN Observability feature."
echo "-rae | --enable-route-advertisements Enable route advertisements"
echo "-adv | --advertise-default-network Applies a RouteAdvertisements configuration to advertise the default network on all nodes"
echo ""
}

Expand Down Expand Up @@ -324,6 +326,8 @@ parse_args() {
;;
-rae | --route-advertisements-enable) ENABLE_ROUTE_ADVERTISEMENTS=true
;;
-adv | --advertise-default-network) ADVERTISE_DEFAULT_NETWORK=true
;;
-ic | --enable-interconnect ) OVN_ENABLE_INTERCONNECT=true
;;
--disable-ovnkube-identity) OVN_ENABLE_OVNKUBE_IDENTITY=false
Expand Down Expand Up @@ -412,6 +416,7 @@ print_params() {
echo "ENABLE_MULTI_NET = $ENABLE_MULTI_NET"
echo "ENABLE_NETWORK_SEGMENTATION= $ENABLE_NETWORK_SEGMENTATION"
echo "ENABLE_ROUTE_ADVERTISEMENTS= $ENABLE_ROUTE_ADVERTISEMENTS"
echo "ADVERTISE_DEFAULT_NETWORK = $ADVERTISE_DEFAULT_NETWORK"
echo "OVN_ENABLE_INTERCONNECT = $OVN_ENABLE_INTERCONNECT"
if [ "$OVN_ENABLE_INTERCONNECT" == true ]; then
echo "KIND_NUM_NODES_PER_ZONE = $KIND_NUM_NODES_PER_ZONE"
Expand Down Expand Up @@ -618,6 +623,7 @@ set_default_params() {
echo "Route advertisements requires multi-network to be enabled (-mne)"
exit 1
fi
ADVERTISE_DEFAULT_NETWORK=${ADVERTISE_DEFAULT_NETWORK:-false}
OVN_COMPACT_MODE=${OVN_COMPACT_MODE:-false}
if [ "$OVN_COMPACT_MODE" == true ]; then
KIND_NUM_WORKER=0
Expand Down Expand Up @@ -866,6 +872,7 @@ create_ovn_kube_manifests() {
--multi-network-enable="${ENABLE_MULTI_NET}" \
--network-segmentation-enable="${ENABLE_NETWORK_SEGMENTATION}" \
--route-advertisements-enable="${ENABLE_ROUTE_ADVERTISEMENTS}" \
--advertise-default-network="${ADVERTISE_DEFAULT_NETWORK}" \
--ovnkube-metrics-scale-enable="${OVN_METRICS_SCALE_ENABLE}" \
--compact-mode="${OVN_COMPACT_MODE}" \
--enable-interconnect="${OVN_ENABLE_INTERCONNECT}" \
Expand Down
7 changes: 7 additions & 0 deletions dist/images/daemonset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ OVN_DISABLE_OVN_IFACE_ID_VER="false"
OVN_MULTI_NETWORK_ENABLE=
OVN_NETWORK_SEGMENTATION_ENABLE=
OVN_ROUTE_ADVERTISEMENTS_ENABLE=
OVN_ADVERTISE_DEFAULT_NETWORK=
OVN_V4_JOIN_SUBNET=""
OVN_V6_JOIN_SUBNET=""
OVN_V4_MASQUERADE_SUBNET=""
Expand Down Expand Up @@ -274,6 +275,9 @@ while [ "$1" != "" ]; do
--route-advertisements-enable)
OVN_ROUTE_ADVERTISEMENTS_ENABLE=$VALUE
;;
--advertise-default-network)
OVN_ADVERTISE_DEFAULT_NETWORK=$VALUE
;;
--egress-service-enable)
OVN_EGRESSSERVICE_ENABLE=$VALUE
;;
Expand Down Expand Up @@ -462,6 +466,8 @@ ovn_network_segmentation_enable=${OVN_NETWORK_SEGMENTATION_ENABLE}
echo "ovn_network_segmentation_enable: ${ovn_network_segmentation_enable}"
ovn_route_advertisements_enable=${OVN_ROUTE_ADVERTISEMENTS_ENABLE}
echo "ovn_route_advertisements_enable: ${ovn_route_advertisements_enable}"
ovn_advertise_default_network=${OVN_ADVERTISE_DEFAULT_NETWORK}
echo "ovn_advertise_default_network: ${ovn_advertise_default_network}"
ovn_hybrid_overlay_net_cidr=${OVN_HYBRID_OVERLAY_NET_CIDR}
echo "ovn_hybrid_overlay_net_cidr: ${ovn_hybrid_overlay_net_cidr}"
ovn_disable_snat_multiple_gws=${OVN_DISABLE_SNAT_MULTIPLE_GWS}
Expand Down Expand Up @@ -1028,6 +1034,7 @@ net_cidr=${net_cidr} svc_cidr=${svc_cidr} \
mtu_value=${mtu} k8s_apiserver=${k8s_apiserver} \
host_network_namespace=${host_network_namespace} \
in_upgrade=${in_upgrade} \
advertise_default_network=${ovn_advertise_default_network} \
jinjanate ../templates/ovn-setup.yaml.j2 -o ${output_dir}/ovn-setup.yaml

ovn_enable_interconnect=${ovn_enable_interconnect} \
Expand Down
11 changes: 11 additions & 0 deletions dist/templates/ovn-setup.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,14 @@ kind: Namespace
metadata:
name: "{{ host_network_namespace }}"
{%- endif %}

{% if advertise_default_network == "true" -%}
---
apiVersion: k8s.ovn.org/v1
kind: RouteAdvertisements
metadata:
name: default
spec:
advertisements:
podNetwork: true
{%- endif %}

0 comments on commit 267985c

Please sign in to comment.