diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 527e8d495a7..0bda53e56c5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -157,6 +157,7 @@ Here are the trigger phrases for individual checks: * `/test-windows-e2e`: Windows IPv4 e2e tests * `/test-windows-conformance`: Windows IPv4 conformance tests * `/test-windows-networkpolicy`: Windows IPv4 networkpolicy tests +* `/test-windows-proxyall-e2e`: Windows IPv4 e2e tests with proxyAll enabled * `/test-ipv6-e2e`: Linux dual stack e2e tests * `/test-ipv6-conformance`: Linux dual stack conformance tests * `/test-ipv6-networkpolicy`: dLinux ual stack networkpolicy tests @@ -168,6 +169,7 @@ Here are the trigger phrases for groups of checks: * `/test-all`: Linux IPv4 tests * `/test-windows-all`: Windows IPv4 tests +* `/test-windows-proxyall-all`: Windows IPv4 tests with proxyAll enabled * `/test-ipv6-all`: Linux dual stack tests * `/test-ipv6-only-all`: Linux IPv6 only tests diff --git a/ci/jenkins/README.md b/ci/jenkins/README.md index 1ea922a698e..f84840e8347 100644 --- a/ci/jenkins/README.md +++ b/ci/jenkins/README.md @@ -113,6 +113,14 @@ DOCKER_REGISTRY="$(head -n1 ci/docker-registry)" ./ci/jenkins/test.sh --testcase windows-networkpolicy --registry ${DOCKER_REGISTRY} ``` +* windows e2e with proxyAll enabled: e2e tests in a Windows setup with proxyAll enabled. + +```shell +#!/bin/bash +DOCKER_REGISTRY="$(head -n1 ci/docker-registry)" +./ci/jenkins/test.sh --testcase windows-e2e --registry ${DOCKER_REGISTRY} --proxyall +``` + * [whole-conformance [daily]](https://jenkins.antrea-ci.rocks/job/antrea-whole-conformance-for-pull-request/): community tests using sonobuoy, with certified-conformance mode. diff --git a/ci/jenkins/test.sh b/ci/jenkins/test.sh index ec727150979..c8e8fc4d278 100755 --- a/ci/jenkins/test.sh +++ b/ci/jenkins/test.sh @@ -30,6 +30,7 @@ MODE="report" DOCKER_REGISTRY=$(head -n1 "${WORKSPACE}/ci/docker-registry") GO_VERSION=$(head -n1 "${WORKSPACE}/build/images/deps/go-version") IMAGE_PULL_POLICY="Always" +PROXY_ALL=false WINDOWS_CONFORMANCE_FOCUS="\[sig-network\].+\[Conformance\]|\[sig-windows\]" WINDOWS_CONFORMANCE_SKIP="\[LinuxOnly\]|\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\]|\[sig-cli\]|\[sig-storage\]|\[sig-auth\]|\[sig-api-machinery\]|\[sig-apps\]|\[sig-node\]|\[Privileged\]|should be able to change the type from|\[sig-network\] Services should be able to create a functioning NodePort service \[Conformance\]|Service endpoints latency should not be very high|should be able to create a functioning NodePort service for Windows" @@ -51,7 +52,8 @@ Run K8s e2e community tests (Conformance & Network Policy) or Antrea e2e tests o --kubeconfig Path of cluster kubeconfig. --workdir Home path for Go, vSphere information and antrea_logs during cluster setup. Default is $WORKDIR. --testcase Windows install OVS, Conformance and Network Policy or Antrea e2e testcases on a Windows or Linux cluster. - --registry The docker registry to use instead of dockerhub." + --registry The docker registry to use instead of dockerhub. + --proxyall Enable proxyAll to test AntreaProxy." function print_usage { echoerr "$_usage" @@ -82,6 +84,10 @@ case $key in DOCKER_REGISTRY="$2" shift 2 ;; + --proxyall) + PROXY_ALL=true + shift + ;; -h|--help) print_usage exit 0 @@ -196,6 +202,7 @@ function collect_windows_network_info_and_logs { function wait_for_antrea_windows_pods_ready { kubectl apply -f "${WORKDIR}/antrea.yml" + # After kube-proxy is fully replaced for Windows, kube-proxy-windows.yml should be applied when PROXY_ALL is false. kubectl apply -f "${WORKDIR}/kube-proxy-windows.yml" kubectl apply -f "${WORKDIR}/antrea-windows.yml" kubectl rollout restart deployment/coredns -n kube-system @@ -270,6 +277,15 @@ function deliver_antrea_windows { export KUBECONFIG=$KUBECONFIG_PATH export_govc_env_var + echo "====== If proxyAll is enabled, update yaml files ======" + if [[ "${PROXY_ALL}" == true ]]; then + KUBERNETES_SVC_EP_IP=$(kubectl get endpoints kubernetes -o jsonpath='{.subsets[0].addresses[0].ip}') + KUBERNETES_SVC_EP_PORT=$(kubectl get endpoints kubernetes -o jsonpath='{.subsets[0].ports[0].port}') + KUBERNETES_SVC_EP_ADDR="${KUBERNETES_SVC_EP_IP}:${KUBERNETES_SVC_EP_PORT}" + sed -i "s|#kubeAPIServerOverride: \"\"|#kubeAPIServerOverride: \"${KUBERNETES_SVC_EP_ADDR}\"|g" build/yamls/antrea.yml build/yamls/antrea-windows.yml + sed -i "s|#proxyAll: false|proxyAll: true|g" build/yamls/antrea.yml build/yamls/antrea-windows.yml + fi + cp -f build/yamls/*.yml $WORKDIR docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:latest