diff --git a/.gitignore b/.gitignore index 2f054d25..7c845970 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Binary output dir bin/ +e2e/bin/ # GOPATH created by the build script gopath/ diff --git a/e2e/README.md b/e2e/README.md index f6ee410d..a9897c3f 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -10,3 +10,9 @@ $ ./get_tools.sh $ ./setup_cluster.sh $ ./test-simple-macvlan1.sh ``` + +### How to teardown cluster + +``` +$ ./teardown.sh +``` diff --git a/e2e/get_tools.sh b/e2e/get_tools.sh index 32f4e48d..2745315a 100755 --- a/e2e/get_tools.sh +++ b/e2e/get_tools.sh @@ -5,7 +5,7 @@ if [ ! -d bin ]; then mkdir bin fi -curl -Lo ./bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(uname)-amd64" +curl -Lo ./bin/kind "https://github.com/kubernetes-sigs/kind/releases/download/v0.8.1/kind-$(uname)-amd64" chmod +x ./bin/kind curl -Lo ./bin/kubectl https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl chmod +x ./bin/kubectl diff --git a/e2e/setup_cluster.sh b/e2e/setup_cluster.sh index 152b3870..7a6bb122 100755 --- a/e2e/setup_cluster.sh +++ b/e2e/setup_cluster.sh @@ -3,32 +3,64 @@ set -o errexit export PATH=${PATH}:./bin +kind_network='kind' reg_name='kind-registry' reg_port='5000' running="$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" if [ "${running}" != 'true' ]; then + # run registry and push the multus image docker run -d --restart=always -p "${reg_port}:5000" --name "${reg_name}" registry:2 + docker build -t localhost:5000/multus:e2e .. + docker push localhost:5000/multus:e2e fi -reg_ip="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' "${reg_name}")" +reg_host="${reg_name}" +if [ "${kind_network}" = "bridge" ]; then + reg_host="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' "${reg_name}")" +fi +echo "Registry Host: ${reg_host}" +# deploy cluster with kind cat <