Run tests with new kind setup script (#8127)

* run tests with new kind setup script

* kind_provisioner fixup for ipv6 and some refactoring

* simplify setup for multicluster/single-cluster doc test with kind_provisioner

* define environment variables required by provisioner

* sync common files
This commit is contained in:
Suchith J N 2020-09-16 21:01:43 +05:30 committed by GitHub
parent 18c5829e60
commit b0fe8d5a9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 99 additions and 6 deletions

View File

@ -19,4 +19,5 @@ CONTAINER_OPTIONS = -p 1313:1313 ${ADDITIONAL_CONTAINER_OPTIONS}
BUILD_WITH_CONTAINER ?= 1
# The release branching scripts use git commands so mount the global .gitconfig into the container
CONDITIONAL_HOST_MOUNTS = --mount type=bind,source=${HOME}/.gitconfig,destination=/config/.gitconfig,readonly ${}
CONDITIONAL_HOST_MOUNTS = --mount type=bind,source=${HOME}/.gitconfig,destination=/config/.gitconfig,readonly \
--mount type=bind,source=/tmp,destination=/tmp ${}

View File

@ -0,0 +1,26 @@
[
{
"cluster_name": "doc_cluster1",
"pod_subnet": "10.10.0.0/16",
"svc_subnet": "10.255.10.0/24",
"network_id": 0,
"control_plane_index": 0,
"config_index": 0
},
{
"cluster_name": "doc_cluster2",
"pod_subnet": "10.20.0.0/16",
"svc_subnet": "10.255.20.0/24",
"network_id": 0,
"control_plane_index": 0,
"config_index": 0
},
{
"cluster_name": "doc_cluster3",
"pod_subnet": "10.30.0.0/16",
"svc_subnet": "10.255.30.0/24",
"network_id": 1,
"control_plane_index": 0,
"config_index": 0
}
]

View File

@ -0,0 +1,10 @@
[
{
"cluster_name": "istio-testing",
"pod_subnet": "10.10.0.0/16",
"svc_subnet": "10.96.0.0/12",
"network_id": 0,
"control_plane_index": 0,
"config_index": 0
}
]

View File

@ -29,8 +29,8 @@ set -u
# Print commands
set -x
# shellcheck source=prow/lib.sh
source "${ROOT}/prow/lib.sh"
# shellcheck source=common/scripts/kind_provisioner.sh
source "${ROOT}/common/scripts/kind_provisioner.sh"
# KinD will not have a LoadBalancer, so we need to disable it
export TEST_ENV=kind
@ -38,15 +38,71 @@ export TEST_ENV=kind
# KinD will have the images loaded into it; it should not attempt to pull them
# See https://kind.sigs.k8s.io/docs/user/quick-start/#loading-an-image-into-your-cluster
export PULL_POLICY=IfNotPresent
export HUB=${HUB:-"gcr.io/istio-testing"}
# Setup junit report and verbose logging
export T="${T:-"-v"}"
export CI="true"
# TOPOLOGY must be specified. Based on that we pick the topology
# configuration file that is used to bring up KinD environment.
TOPOLOGY="SINGLE_CLUSTER"
# This is relevant only when multicluster topology is picked
CLUSTER_TOPOLOGY_CONFIG_FILE="./prow/config/topology/multi-cluster.json"
PARAMS=()
while (( "$#" )); do
case $1 in
--topology)
case $2 in
SINGLE_CLUSTER | MULTICLUSTER)
TOPOLOGY=$2
;;
*)
echo "unknown topology: $2. Valid ones: SINGLE_CLUSTER, MULTICLUSTER"
exit 1
;;
esac
shift 2
;;
--topology-config)
CLUSTER_TOPOLOGY_CONFIG_FILE=$2
shift 2
;;
-*)
echo "Error: unsupported flag: $1" >&2
exit 1
;;
*)
PARAMS+=("$1")
shift
;;
esac
done
export IP_FAMILY="${IP_FAMILY:-ipv4}"
export NODE_IMAGE="kindest/node:v1.18.2"
if [[ -z "${SKIP_SETUP:-}" ]]; then
time setup_kind_cluster "${NODE_IMAGE:-}"
export ARTIFACTS="${ARTIFACTS:-$(mktemp -d)}"
export DEFAULT_CLUSTER_YAML="./prow/config/trustworthy-jwt.yaml"
export METRICS_SERVER_CONFIG_DIR=''
if [[ "${TOPOLOGY}" == "SINGLE_CLUSTER" ]]; then
time setup_kind_cluster
else
time load_cluster_topology "${CLUSTER_TOPOLOGY_CONFIG_FILE}"
time setup_kind_clusters "${NODE_IMAGE}" "${IP_FAMILY}"
export TEST_ENV=kind-metallb
export DOCTEST_KUBECONFIG
DOCTEST_KUBECONFIG=$(IFS=':'; echo "${KUBECONFIGS[*]}")
fi
fi
make "${@}"
make "${PARAMS[*]}"