From 8cba9584ab08869c7381828b9d87a5aff507e7a9 Mon Sep 17 00:00:00 2001 From: zirain Date: Fri, 6 Dec 2024 13:39:54 +0800 Subject: [PATCH] ci: enable ipv6 test (#4853) enable ipv6 test Signed-off-by: zirain --- .github/workflows/build_and_test.yaml | 6 ++---- test/config/gatewayclass.yaml | 13 ++++++++++++ test/e2e/testdata/envoyproxy-daemonset.yaml | 1 + .../e2e/testdata/gateway-with-envoyproxy.yaml | 1 + test/e2e/testdata/httproute-routingtype.yaml | 1 + test/e2e/testdata/tracing-datadog.yaml | 1 + test/e2e/testdata/tracing-zipkin.yaml | 1 + test/e2e/upgrade/manifests.yaml | 1 + tools/make/kube.mk | 21 +++++++++++++++---- 9 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 1c5e826076b..fcb6631782e 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -120,10 +120,7 @@ jobs: - version: v1.29.8 ipFamily: ipv4 - version: v1.30.4 - ipFamily: ipv4 - # Enable these after https://github.com/envoyproxy/gateway/issues/4572 fixed - # - version: v1.31.0 - # ipFamily: ipv6 # only run ipv6 test on latest version to save time + ipFamily: ipv6 # only run ipv6 test on this version to save time # TODO: this's IPv4 first, need a way to test IPv6 first. - version: v1.31.0 ipFamily: dual # only run dual test on latest version to save time @@ -148,6 +145,7 @@ jobs: KIND_NODE_TAG: ${{ matrix.target.version }} IMAGE_PULL_POLICY: IfNotPresent IP_FAMILY: ${{ matrix.target.ipFamily }} + E2E_TIMEOUT: 1h run: make e2e benchmark-test: diff --git a/test/config/gatewayclass.yaml b/test/config/gatewayclass.yaml index 6e8acf3d0f8..d47d1e10a9a 100644 --- a/test/config/gatewayclass.yaml +++ b/test/config/gatewayclass.yaml @@ -16,6 +16,7 @@ metadata: name: proxy-config namespace: envoy-gateway-system spec: + ipFamily: IPv4 provider: type: Kubernetes kubernetes: @@ -124,6 +125,7 @@ metadata: name: upgrade-config namespace: envoy-gateway-system spec: + ipFamily: IPv4 provider: type: Kubernetes kubernetes: @@ -158,6 +160,7 @@ metadata: name: merge-gateways-config namespace: envoy-gateway-system spec: + ipFamily: IPv4 mergeGateways: true --- kind: GatewayClass @@ -166,6 +169,11 @@ metadata: name: internet spec: controllerName: gateway.envoyproxy.io/gatewayclass-controller + parametersRef: + group: gateway.envoyproxy.io + kind: EnvoyProxy + name: proxy-config + namespace: envoy-gateway-system --- kind: GatewayClass apiVersion: gateway.networking.k8s.io/v1 @@ -173,5 +181,10 @@ metadata: name: private spec: controllerName: gateway.envoyproxy.io/gatewayclass-controller + parametersRef: + group: gateway.envoyproxy.io + kind: EnvoyProxy + name: proxy-config + namespace: envoy-gateway-system --- diff --git a/test/e2e/testdata/envoyproxy-daemonset.yaml b/test/e2e/testdata/envoyproxy-daemonset.yaml index fabe93e5420..a7f1e4509cb 100644 --- a/test/e2e/testdata/envoyproxy-daemonset.yaml +++ b/test/e2e/testdata/envoyproxy-daemonset.yaml @@ -24,6 +24,7 @@ metadata: name: eg-daemonset namespace: gateway-conformance-infra spec: + ipFamily: IPv4 provider: type: Kubernetes kubernetes: diff --git a/test/e2e/testdata/gateway-with-envoyproxy.yaml b/test/e2e/testdata/gateway-with-envoyproxy.yaml index 0d04562c13d..c62d0cc8584 100644 --- a/test/e2e/testdata/gateway-with-envoyproxy.yaml +++ b/test/e2e/testdata/gateway-with-envoyproxy.yaml @@ -24,6 +24,7 @@ metadata: namespace: gateway-conformance-infra name: test spec: + ipFamily: IPv4 routingType: Service --- apiVersion: gateway.networking.k8s.io/v1 diff --git a/test/e2e/testdata/httproute-routingtype.yaml b/test/e2e/testdata/httproute-routingtype.yaml index 72cd366a630..8c0d889f220 100644 --- a/test/e2e/testdata/httproute-routingtype.yaml +++ b/test/e2e/testdata/httproute-routingtype.yaml @@ -4,6 +4,7 @@ metadata: name: custom-proxy-config namespace: gateway-conformance-infra spec: + ipFamily: IPv4 routingType: Service --- apiVersion: gateway.networking.k8s.io/v1 diff --git a/test/e2e/testdata/tracing-datadog.yaml b/test/e2e/testdata/tracing-datadog.yaml index e4f54a7eebe..fa6024ee81e 100644 --- a/test/e2e/testdata/tracing-datadog.yaml +++ b/test/e2e/testdata/tracing-datadog.yaml @@ -39,6 +39,7 @@ metadata: name: datadog-tracing namespace: gateway-conformance-infra spec: + ipFamily: IPv4 logging: level: default: debug diff --git a/test/e2e/testdata/tracing-zipkin.yaml b/test/e2e/testdata/tracing-zipkin.yaml index 1f7aaf0a66f..b2c04bd9761 100644 --- a/test/e2e/testdata/tracing-zipkin.yaml +++ b/test/e2e/testdata/tracing-zipkin.yaml @@ -26,6 +26,7 @@ metadata: name: zipkin-tracing namespace: gateway-conformance-infra spec: + ipFamily: IPv4 logging: level: default: debug diff --git a/test/e2e/upgrade/manifests.yaml b/test/e2e/upgrade/manifests.yaml index 363ede65779..3b59689dd24 100644 --- a/test/e2e/upgrade/manifests.yaml +++ b/test/e2e/upgrade/manifests.yaml @@ -18,6 +18,7 @@ metadata: name: upgrade-config namespace: envoy-gateway-system spec: + ipFamily: IPv4 provider: type: Kubernetes kubernetes: diff --git a/tools/make/kube.mk b/tools/make/kube.mk index 122e089b79e..ecb458e2791 100644 --- a/tools/make/kube.mk +++ b/tools/make/kube.mk @@ -12,6 +12,7 @@ GATEWAY_RELEASE_URL ?= https://github.com/kubernetes-sigs/gateway-api/releases/d WAIT_TIMEOUT ?= 15m +IP_FAMILY ?= ipv4 BENCHMARK_TIMEOUT ?= 60m BENCHMARK_CPU_LIMITS ?= 1000m BENCHMARK_MEMORY_LIMITS ?= 1024Mi @@ -35,11 +36,23 @@ ifeq ($(origin KUBE_INFRA_DIR),undefined) KUBE_INFRA_DIR := $(ROOT_DIR)/internal/infrastructure/kubernetes/config endif +ifeq ($(IP_FAMILY),ipv4) +ENVOY_PROXY_IP_FAMILY := IPv4 +else ifeq ($(IP_FAMILY),ipv6) +ENVOY_PROXY_IP_FAMILY := IPv6 +else ifeq ($(IP_FAMILY),dual) +ENVOY_PROXY_IP_FAMILY := DualStack +endif + ##@ Kubernetes Development YEAR := $(shell date +%Y) CONTROLLERGEN_OBJECT_FLAGS := object:headerFile="$(ROOT_DIR)/tools/boilerplate/boilerplate.generatego.txt",year=$(YEAR) +.PHONY: prepare-ip-family +prepare-ip-family: + @find ./test -type f -name "*.yaml" | xargs sed -i -e 's/ipFamily: IPv4/ipFamily: $(ENVOY_PROXY_IP_FAMILY)/g' + .PHONY: manifests manifests: $(tools/controller-gen) generate-gwapi-manifests ## Generate WebhookConfiguration and CustomResourceDefinition objects. @$(LOG_TARGET) @@ -145,7 +158,7 @@ install-ratelimit: kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-ratelimit --for=condition=Available .PHONY: e2e-prepare -e2e-prepare: ## Prepare the environment for running e2e tests +e2e-prepare: prepare-ip-family ## Prepare the environment for running e2e tests @$(LOG_TARGET) kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-ratelimit --for=condition=Available kubectl wait --timeout=5m -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available @@ -165,7 +178,7 @@ else endif .PHONY: run-benchmark -run-benchmark: install-benchmark-server ## Run benchmark tests +run-benchmark: install-benchmark-server prepare-ip-family ## Run benchmark tests @$(LOG_TARGET) mkdir -p $(OUTPUT_DIR)/benchmark kubectl wait --timeout=$(WAIT_TIMEOUT) -n benchmark-test deployment/nighthawk-test-server --for=condition=Available @@ -221,7 +234,7 @@ kube-install-image: image.build $(tools/kind) ## Install the EG image to a kind tools/hack/kind-load-image.sh $(IMAGE) $(TAG) .PHONY: run-conformance -run-conformance: ## Run Gateway API conformance. +run-conformance: prepare-ip-family ## Run Gateway API conformance. @$(LOG_TARGET) kubectl wait --timeout=$(WAIT_TIMEOUT) -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available kubectl apply -f test/config/gatewayclass.yaml @@ -230,7 +243,7 @@ run-conformance: ## Run Gateway API conformance. CONFORMANCE_REPORT_PATH ?= .PHONY: run-experimental-conformance -run-experimental-conformance: ## Run Experimental Gateway API conformance. +run-experimental-conformance: prepare-ip-family ## Run Experimental Gateway API conformance. @$(LOG_TARGET) kubectl wait --timeout=$(WAIT_TIMEOUT) -n envoy-gateway-system deployment/envoy-gateway --for=condition=Available kubectl apply -f test/config/gatewayclass.yaml