From d4ea89444962ce18475ab0c2a3a5cd8bc8edbe69 Mon Sep 17 00:00:00 2001 From: Ben Moss Date: Thu, 22 Oct 2020 14:32:13 -0400 Subject: [PATCH] Add CAPI kubetest2 deployer --- test/kubetest2-capi/OWNERS | 13 + test/kubetest2-capi/README.md | 53 ++ test/kubetest2-capi/deployer/deployer.go | 240 +++++ test/kubetest2-capi/go.mod | 10 + test/kubetest2-capi/go.sum | 1107 ++++++++++++++++++++++ test/kubetest2-capi/main.go | 26 + 6 files changed, 1449 insertions(+) create mode 100644 test/kubetest2-capi/OWNERS create mode 100644 test/kubetest2-capi/README.md create mode 100644 test/kubetest2-capi/deployer/deployer.go create mode 100644 test/kubetest2-capi/go.mod create mode 100644 test/kubetest2-capi/go.sum create mode 100644 test/kubetest2-capi/main.go diff --git a/test/kubetest2-capi/OWNERS b/test/kubetest2-capi/OWNERS new file mode 100644 index 000000000000..ed5ce8a4a3e3 --- /dev/null +++ b/test/kubetest2-capi/OWNERS @@ -0,0 +1,13 @@ +# See the OWNERS docs at https://go.k8s.io/owners for information on OWNERS files. +# See the OWNERS_ALIASES file at https://github.com/kubernetes-sigs/cluster-api/blob/master/OWNERS_ALIASES for a list of members for each alias. + +approvers: + - cluster-api-admins + - cluster-api-maintainers + - benmoss + - elmiko + - randomvariable + +reviewers: + - cluster-api-maintainers + - cluster-api-reviewers diff --git a/test/kubetest2-capi/README.md b/test/kubetest2-capi/README.md new file mode 100644 index 000000000000..b8f880f98d23 --- /dev/null +++ b/test/kubetest2-capi/README.md @@ -0,0 +1,53 @@ +# Kubetest2 Cluster API Deployer + +This component of [kubetest2](https://github.com/kubernetes-sigs/kubetest2) is +responsible for test cluster lifecycles for clusters deployed with Cluster API. + +Users can use this project along with kubetest2 testers to run [Kubernetes +e2e tests](https://github.com/kubernetes/kubernetes/tree/master/test/e2e) +against CAPI-backed clusters. + +## Installation +``` +GO111MODULE=on go get sigs.k8s.io/cluster-api/test/kubetest2-capi@latest +``` + +## Usage + +As an example, to deploy with CAPD: + +``` +export KIND_EXPERIMENTAL_DOCKER_NETWORK=bridge +kubetest2 capi --provider docker --kubernetes-version 1.19.1 --up --down +``` + +Currently this provider does not fully support the kubetest2 `--build` feature. +It is possible to build and deploy only with the [CAPD +provider](../infrastructure/docker), since CAPD takes advantage of the node +images that Kind builds. As an example of how this can be done: + +```bash +kubeRoot=$HOME/workspace/kubernetes + +pushd $kubeRoot +export KUBE_GIT_VERSION=$(hack/print-workspace-status.sh | grep gitVersion | cut -d' ' -f2 | cut -d'+' -f1) +export KUBERNETES_VERSION=$KUBE_GIT_VERSION +popd +export KIND_EXPERIMENTAL_DOCKER_NETWORK=bridge +cat <