Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: enable ipv6 test #4853

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
13 changes: 13 additions & 0 deletions test/config/gatewayclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ metadata:
name: proxy-config
namespace: envoy-gateway-system
spec:
ipFamily: IPv4
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IpFamily needs to be set explicitly, sed will change it to right value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: use {IP_FAMILY} instead of IPv4 to make it clearer?

Copy link
Member Author

@zirain zirain Dec 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use IPv4 directly allow you apply this file without run make prepare-ip-family for debugging

provider:
type: Kubernetes
kubernetes:
Expand Down Expand Up @@ -124,6 +125,7 @@ metadata:
name: upgrade-config
namespace: envoy-gateway-system
spec:
ipFamily: IPv4
provider:
type: Kubernetes
kubernetes:
Expand Down Expand Up @@ -158,6 +160,7 @@ metadata:
name: merge-gateways-config
namespace: envoy-gateway-system
spec:
ipFamily: IPv4
mergeGateways: true
---
kind: GatewayClass
Expand All @@ -166,12 +169,22 @@ 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
metadata:
name: private
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
parametersRef:
group: gateway.envoyproxy.io
kind: EnvoyProxy
name: proxy-config
namespace: envoy-gateway-system
---

1 change: 1 addition & 0 deletions test/e2e/testdata/envoyproxy-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ metadata:
name: eg-daemonset
namespace: gateway-conformance-infra
spec:
ipFamily: IPv4
provider:
type: Kubernetes
kubernetes:
Expand Down
1 change: 1 addition & 0 deletions test/e2e/testdata/gateway-with-envoyproxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ metadata:
namespace: gateway-conformance-infra
name: test
spec:
ipFamily: IPv4
routingType: Service
---
apiVersion: gateway.networking.k8s.io/v1
Expand Down
1 change: 1 addition & 0 deletions test/e2e/testdata/httproute-routingtype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ metadata:
name: custom-proxy-config
namespace: gateway-conformance-infra
spec:
ipFamily: IPv4
routingType: Service
---
apiVersion: gateway.networking.k8s.io/v1
Expand Down
1 change: 1 addition & 0 deletions test/e2e/testdata/tracing-datadog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ metadata:
name: datadog-tracing
namespace: gateway-conformance-infra
spec:
ipFamily: IPv4
logging:
level:
default: debug
Expand Down
1 change: 1 addition & 0 deletions test/e2e/testdata/tracing-zipkin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ metadata:
name: zipkin-tracing
namespace: gateway-conformance-infra
spec:
ipFamily: IPv4
logging:
level:
default: debug
Expand Down
1 change: 1 addition & 0 deletions test/e2e/upgrade/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ metadata:
name: upgrade-config
namespace: envoy-gateway-system
spec:
ipFamily: IPv4
provider:
type: Kubernetes
kubernetes:
Expand Down
21 changes: 17 additions & 4 deletions tools/make/kube.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading