Skip to content

Commit

Permalink
Merge remote-tracking branch 'ovn-org/master' into d/s-merge-01-08-2025
Browse files Browse the repository at this point in the history
  • Loading branch information
jluhrsen committed Jan 9, 2025
2 parents 038aea1 + 4153d10 commit 1759248
Show file tree
Hide file tree
Showing 258 changed files with 16,448 additions and 8,619 deletions.
57 changes: 42 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# separate job for parallelism
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -57,7 +57,7 @@ jobs:

build-master:
name: Build-master
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# Create a cache for the built master image
- name: Restore master image cache
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:

build-pr:
name: Build-PR
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# Create a cache for the build PR image
- name: Restore PR image cache
Expand Down Expand Up @@ -195,8 +195,9 @@ jobs:
run: |
set -x
pushd go-controller
# exit early if there are gofmt issues
# exit early if there are gofmt or go mod / vendor issues
make gofmt
make verify-go-mod-vendor
make
make windows
COVERALLS=1 CONTAINER_RUNNABLE=1 make check
Expand Down Expand Up @@ -256,7 +257,7 @@ jobs:
ovn-upgrade-e2e:
name: Upgrade OVN from Master to PR branch based image
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 120
needs:
- build-master
Expand Down Expand Up @@ -327,7 +328,7 @@ jobs:
if: always()
run: |
mkdir -p /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --verbosity 4 /tmp/kind/logs
set -x
docker ps -a
docker exec ovn-control-plane crictl images
Expand Down Expand Up @@ -375,7 +376,7 @@ jobs:
if: always()
run: |
mkdir -p /tmp/kind/logs-kind-pr-branch
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs-kind-pr-branch
kind export logs --name ${KIND_CLUSTER_NAME} --verbosity 4 /tmp/kind/logs-kind-pr-branch
- name: Upload kind logs
if: always()
Expand All @@ -386,7 +387,7 @@ jobs:

e2e:
name: e2e
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# 30 mins for kind, 180 mins for control-plane tests, 10 minutes for all other steps
timeout-minutes: 220
strategy:
Expand All @@ -406,13 +407,14 @@ jobs:
# num-nodes-per-zone : "<integer value>"
# forwarding : ["", "disable-forwarding"]
# dns-name-resolver : ["", "enable-dns-name-resolver"]
# traffic-flow-tests : "<tests range. i.e. 1-24>"
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": "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"}
- {"target": "control-plane", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "control-plane", "ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled", "traffic-flow-tests": "1,2,3"}
- {"target": "control-plane-helm","ha": "HA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-disabled", "dns-name-resolver": "enable-dns-name-resolver"}
- {"target": "control-plane-helm","ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "snatGW", "second-bridge": "1br", "ic": "ic-single-node-zones", "dns-name-resolver": "enable-dns-name-resolver"}
- {"target": "control-plane", "ha": "noHA", "gateway-mode": "local", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones", "dns-name-resolver": "enable-dns-name-resolver"}
Expand All @@ -437,6 +439,8 @@ jobs:
- {"target": "network-segmentation", "ha": "noHA", "gateway-mode": "local", "ipfamily": "dualstack", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "network-segmentation", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "dualstack", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-disabled"}
- {"target": "network-segmentation", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "network-segmentation", "ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv6", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
- {"target": "traffic-flow-test-only","ha": "noHA", "gateway-mode": "shared", "ipfamily": "ipv4", "disable-snat-multiple-gws": "noSnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones", "traffic-flow-tests": "1-24"}
- {"target": "tools", "ha": "noHA", "gateway-mode": "local", "ipfamily": "dualstack", "disable-snat-multiple-gws": "SnatGW", "second-bridge": "1br", "ic": "ic-single-node-zones"}
needs: [ build-pr ]
env:
Expand All @@ -446,13 +450,13 @@ jobs:
OVN_EMPTY_LB_EVENTS: "${{ matrix.target == 'control-plane' || matrix.target == 'control-plane-helm' }}"
OVN_HA: "${{ matrix.ha == 'HA' }}"
OVN_DISABLE_SNAT_MULTIPLE_GWS: "${{ matrix.disable-snat-multiple-gws == 'noSnatGW' }}"
KIND_INSTALL_METALLB: "${{ matrix.target == 'control-plane' || matrix.target == 'control-plane-helm' }}"
KIND_INSTALL_METALLB: "${{ matrix.target == 'control-plane' || matrix.target == 'control-plane-helm' || matrix.target == 'network-segmentation' }}"
OVN_GATEWAY_MODE: "${{ matrix.gateway-mode }}"
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_NETWORK_SEGMENTATION: "${{ matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'kv-live-migration'}}"
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' }}"
ENABLE_NETWORK_SEGMENTATION: "${{ matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'kv-live-migration' || matrix.target == 'traffic-flow-test-only' }}"
DISABLE_UDN_HOST_ISOLATION: "true"
KIND_INSTALL_KUBEVIRT: "${{ matrix.target == 'kv-live-migration' }}"
OVN_COMPACT_MODE: "${{ matrix.target == 'compact-mode' }}"
Expand All @@ -463,6 +467,7 @@ 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' }}"
TRAFFIC_FLOW_TESTS: "${{ matrix.traffic-flow-tests }}"
steps:

- name: Install VRF kernel module
Expand All @@ -482,6 +487,11 @@ jobs:
msbuild mysql-server-core-* php-* php7* \
powershell temurin-* zulu-*
- name: Setup /mnt/runner directory
run: |
sudo mkdir -pv /mnt/runner
sudo chown runner:runner /mnt/runner
- name: Check out code into the Go module directory
uses: actions/checkout@v4

Expand Down Expand Up @@ -523,6 +533,11 @@ jobs:
export OVN_IMAGE="ovn-daemonset-fedora:pr"
make -C test install-kind
- name: traffic-flow-tests setup
timeout-minutes: 5
if: env.TRAFFIC_FLOW_TESTS != ''
run: make -C test traffic-flow-tests WHAT="setup"

- name: Runner Diagnostics
uses: ./.github/actions/diagnostics

Expand Down Expand Up @@ -554,21 +569,33 @@ jobs:
elif [ "${{ matrix.target }}" == "tools" ]; then
make -C go-controller build
make -C test tools
elif [ "${{ matrix.target }}" == "traffic-flow-test-only" ]; then
# Traffic Flow Tests can be ran as part of a target, as an additional
# set of test, set via TRAFFIC_FLOW_TESTS. See below.
:
else
make -C test ${{ matrix.target }}
if [ "${{ matrix.ipfamily }}" != "ipv6" ]; then
make -C test conformance
fi
fi
# If target also specified traffic flow tests to run, do so now
if [ -n "${TRAFFIC_FLOW_TESTS}" ]; then
make -C test traffic-flow-tests WHAT="run"
fi
- name: Runner Diagnostics
uses: ./.github/actions/diagnostics

- name: Export kind logs
if: always()
run: |
mkdir -p /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --verbosity 4 /tmp/kind/logs
if [ -n "${TRAFFIC_FLOW_TESTS}" ]; then
mv -v /tmp/{,kind/logs/}traffic_flow_test_result.json ||:
fi
- name: Upload kind logs
if: always()
Expand All @@ -580,7 +607,7 @@ jobs:
e2e-dual-conversion:
name: e2e-dual-conversion
if: github.event_name != 'schedule'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
timeout-minutes: 60
strategy:
fail-fast: false
Expand Down Expand Up @@ -675,7 +702,7 @@ jobs:
if: always()
run: |
mkdir -p /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --loglevel=debug /tmp/kind/logs
kind export logs --name ${KIND_CLUSTER_NAME} --verbosity 4 /tmp/kind/logs
- name: Upload kind logs
if: always()
Expand Down
14 changes: 6 additions & 8 deletions contrib/kind-common
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,18 @@ install_ingress() {

METALLB_DIR="/tmp/metallb"
install_metallb() {
local metallb_version=v0.14.8
# TODO: Pin to a version tag bigger than v0.14.8 when released
# so we can have a metallb dev-env that support dual stack
# and use a proper tag instead of a commit id.
local metallb_version=55f648102b918699da610f20e8d650e76c7561fc
mkdir -p /tmp/metallb
local builddir
builddir=$(mktemp -d "${METALLB_DIR}/XXXXXX")

pushd "${builddir}"
git clone https://github.com/metallb/metallb.git -b $metallb_version
git clone https://github.com/metallb/metallb.git
cd metallb
# Use global IP next hops in IPv6
if [ "$KIND_IPV6_SUPPORT" == true ]; then
sed -i '/address-family PROTOCOL unicast/a \
neighbor NODE0_IP route-map IPV6GLOBAL in\n neighbor NODE1_IP route-map IPV6GLOBAL in\n neighbor NODE2_IP route-map IPV6GLOBAL in' dev-env/bgp/frr/bgpd.conf.tmpl
printf "route-map IPV6GLOBAL permit 10\n set ipv6 next-hop prefer-global" >> dev-env/bgp/frr/bgpd.conf.tmpl
fi
git checkout $metallb_version
pip install -r dev-env/requirements.txt

local ip_family ipv6_network
Expand Down
2 changes: 1 addition & 1 deletion contrib/kind-dual-stack-conversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ convert_cni() {
# restart ovnkube-master
# FIXME: kubectl rollout restart deployment leaves the old pod hanging
# as workaround we delete the master directly. When deployed with
# OVN_INTERCONNECT_ENABLE=true, the db and ncm pods need that too.
# OVN_INTERCONNECT_ENABLE=true, the db and cm pods need that too.
# Depending on how kind was deployed, the pods have different labels.
kubectl -n ovn-kubernetes delete pod -l name=ovnkube-db ||:
kubectl -n ovn-kubernetes delete pod -l name=ovnkube-zone-controller ||:
Expand Down
4 changes: 4 additions & 0 deletions contrib/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ set_default_params() {
echo "Route advertisements requires multi-network to be enabled (-mne)"
exit 1
fi
if [ "$ENABLE_ROUTE_ADVERTISEMENTS" == true ] && [ "$OVN_ENABLE_INTERCONNECT" != true ]; then
echo "Route advertisements requires interconnect to be enabled (-ic)"
exit 1
fi
OVN_COMPACT_MODE=${OVN_COMPACT_MODE:-false}
if [ "$OVN_COMPACT_MODE" == true ]; then
KIND_NUM_WORKER=0
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.ubuntu.arm64
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FROM ubuntu:24.10

USER root

RUN apt-get update && apt-get install -y iproute2 curl software-properties-common util-linux
RUN apt-get update && apt-get install -y iproute2 curl software-properties-common util-linux nftables

RUN curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

Expand Down
2 changes: 2 additions & 0 deletions dist/images/daemonset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,12 @@ ovn_enable_dnsnameresolver=${ovn_enable_dnsnameresolver} \

ovn_network_segmentation_enable=${ovn_network_segmentation_enable} \
ovn_enable_dnsnameresolver=${ovn_enable_dnsnameresolver} \
ovn_route_advertisements_enable=${ovn_route_advertisements_enable} \
jinjanate ../templates/rbac-ovnkube-cluster-manager.yaml.j2 -o ${output_dir}/rbac-ovnkube-cluster-manager.yaml

ovn_network_segmentation_enable=${ovn_network_segmentation_enable} \
ovn_enable_dnsnameresolver=${ovn_enable_dnsnameresolver} \
ovn_route_advertisements_enable=${ovn_route_advertisements_enable} \
jinjanate ../templates/rbac-ovnkube-master.yaml.j2 -o ${output_dir}/rbac-ovnkube-master.yaml

cp ../templates/rbac-ovnkube-identity.yaml.j2 ${output_dir}/rbac-ovnkube-identity.yaml
Expand Down
3 changes: 3 additions & 0 deletions dist/templates/k8s.ovn.org_routeadvertisements.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ spec:
description: advertisements determines what is advertised.
items:
description: AdvertisementType determines the type of advertisement.
enum:
- PodNetwork
- EgressIP
type: string
maxItems: 2
minItems: 1
Expand Down
6 changes: 6 additions & 0 deletions dist/templates/rbac-ovnkube-cluster-manager.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@ rules:
- dnsnameresolvers
verbs: [ "create", "delete", "list", "patch", "update", "watch" ]
{%- endif %}
{% if ovn_route_advertisements_enable == "true" -%}
- apiGroups: ["frrk8s.metallb.io"]
resources:
- frrconfigurations
verbs: [ "create", "delete", "list", "patch", "update", "watch" ]
{%- endif %}
2 changes: 0 additions & 2 deletions dist/templates/rbac-ovnkube-master.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ rules:
- adminpolicybasedexternalroutes
- userdefinednetworks
- clusteruserdefinednetworks
- routeadvertisements
verbs: [ "get", "list", "watch" ]
- apiGroups: ["k8s.cni.cncf.io"]
resources:
Expand Down Expand Up @@ -120,7 +119,6 @@ rules:
- clusteruserdefinednetworks
- clusteruserdefinednetworks/status
- clusteruserdefinednetworks/finalizers
- routeadvertisements/status
verbs: [ "patch", "update" ]
- apiGroups: [""]
resources:
Expand Down
3 changes: 3 additions & 0 deletions go-controller/.mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ packages:
github.com/containernetworking/plugins/pkg/ns:
interfaces:
NetNS:
github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/informers/externalversions/k8s.cni.cncf.io/v1:
interfaces:
NetworkAttachmentDefinitionInformer:
github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/client/listers/k8s.cni.cncf.io/v1:
interfaces:
NetworkAttachmentDefinitionLister:
Expand Down
9 changes: 8 additions & 1 deletion go-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ clean:
rm -f ./pkg/sbdb/ovn-sb.ovsschema
rm -f ./pkg/vswitchd/vswitch.ovsschema

.PHONY: lint gofmt
.PHONY: lint gofmt verify-go-mod-vendor

lint:
ifeq ($(CONTAINER_RUNNABLE), 0)
Expand All @@ -105,6 +105,13 @@ else
@./hack/verify-gofmt.sh
endif

verify-go-mod-vendor:
ifeq ($(CONTAINER_RUNNABLE), 0)
@GOPATH=${GOPATH} ./hack/verify-go-mod-vendor.sh
else
@./hack/verify-go-mod-vendor.sh
endif

pkg/nbdb/ovn-nb.ovsschema:
curl -sSL https://raw.githubusercontent.com/ovn-org/ovn/$(OVN_SCHEMA_VERSION)/ovn-nb.ovsschema -o $@

Expand Down
Loading

0 comments on commit 1759248

Please sign in to comment.