From 8702d60b84151de2e99d7bfac1bd8bbc8dd02756 Mon Sep 17 00:00:00 2001 From: Yossi Boaron Date: Mon, 18 Nov 2024 15:34:20 +0200 Subject: [PATCH 1/2] Add support for Kind OVNK IPV6 deployment This PR depends on ovn-kubernetes PR [1] [1] https://github.com/ovn-kubernetes/ovn-kubernetes/pull/4955 Signed-off-by: Yossi Boaron --- package/Dockerfile.shipyard-dapper-base | 2 +- scripts/shared/lib/clusters_kind | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/package/Dockerfile.shipyard-dapper-base b/package/Dockerfile.shipyard-dapper-base index 0143cf50..a53c437d 100644 --- a/package/Dockerfile.shipyard-dapper-base +++ b/package/Dockerfile.shipyard-dapper-base @@ -4,7 +4,7 @@ FROM fedora:41 # good balance between compression time and resulting image size. ARG UPX_LEVEL=-5 ENV DAPPER_HOST_ARCH=amd64 SHIPYARD_DIR=/opt/shipyard SHELL=/bin/bash \ - DAPPER_RUN_ARGS="--net=kind" + DAPPER_RUN_ARGS="--net=kind --cap-add=NET_ADMIN --privileged=true" ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} PATH=/go/bin:/root/.local/bin:/usr/local/go/bin:$PATH \ GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${DAPPER_HOST_ARCH} \ GOPATH=/go GO111MODULE=on GOPROXY=https://proxy.golang.org \ diff --git a/scripts/shared/lib/clusters_kind b/scripts/shared/lib/clusters_kind index 953d5da5..0babde3c 100755 --- a/scripts/shared/lib/clusters_kind +++ b/scripts/shared/lib/clusters_kind @@ -196,12 +196,24 @@ EOF function deploy_kind_ovn(){ export K8S_VERSION - export NET_CIDR_IPV4="${cluster_CIDRs[${cluster}]}" - export SVC_CIDR_IPV4="${service_CIDRs[${cluster}]}" + export SVC_CIDR_IPV4 + export NET_CIDR_IPV4 + export SVC_CIDR_IPV6 + export NET_CIDR_IPV6 export KIND_CLUSTER_NAME="${cluster}" local ovn_flags=() [[ "$OVN_IC" != true ]] || ovn_flags=( -ic -npz 1 -wk 3 ) + + if [[ "$IPV6_STACK" ]]; then + ovn_flags+=( -n4 -i6 -sw) + SVC_CIDR_IPV6="${service_IPv6_CIDRs[${cluster}]}" + NET_CIDR_IPV6="${cluster_IPv6_CIDRs[${cluster}]}" + else + NET_CIDR_IPV4="${cluster_CIDRs[${cluster}]}" + SVC_CIDR_IPV4="${service_CIDRs[${cluster}]}" + fi + delete_cluster_on_fail ./ovn-kubernetes/contrib/kind.sh -ov "$OVN_IMAGE" -cn "${KIND_CLUSTER_NAME}" -ric "${ovn_flags[@]}" -lr -dd "${KIND_CLUSTER_NAME}.local" --disable-ovnkube-identity [[ "$AIR_GAPPED" = true ]] && air_gap_iptables From de13e58b0f6942af3a2b1f24987f2333ccc124ac Mon Sep 17 00:00:00 2001 From: Yossi Boaron Date: Tue, 14 Jan 2025 15:20:45 +0200 Subject: [PATCH 2/2] Workaround until ipv6 bugfix merge Workaround until commit [1] is delivered in ovn-kubernetes branch [1] https://github.com/ovn-kubernetes/ovn-kubernetes/pull/4955 Signed-off-by: Yossi Boaron --- scripts/shared/lib/clusters_kind | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/shared/lib/clusters_kind b/scripts/shared/lib/clusters_kind index 0babde3c..b9a0f10c 100755 --- a/scripts/shared/lib/clusters_kind +++ b/scripts/shared/lib/clusters_kind @@ -264,6 +264,9 @@ function prepare_ovn() { # When updating commit, Update the OVN_SRC_IMAGE to the corressponding commit git checkout 24b0ae73a996e409bfefad7b90cb42224e34be54 + git fetch origin pull/4955/head:kind_ipv6_fix + git config --global fufu.email "fufu@here.com" + git cherry-pick kind_ipv6_fix local OVN_SRC_IMAGE="ghcr.io/ovn-org/ovn-kubernetes/ovn-kube-u:master@sha256:ba102783d520f0474e5c7dd5f2a0a1dce0ec2bda6cd42ac547621892e57c25e2" docker pull "${OVN_SRC_IMAGE}"