Skip to content

Commit 2547272

Browse files
authored
Merge pull request #1500 from wwentland/doc-local-e2e-env
📖 Add documentation for creating local test environments
2 parents e22c52f + 864a444 commit 2547272

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

docs/book/src/development/development.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ $ openstack network list --external
102102
+--------------------------------------+----------+--------------------------------------+
103103
```
104104

105-
### OpenStack prerequisites
105+
### E2E test environment
106+
107+
The test suite is executed in an existing OpenStack environment. You can create and manage this environment yourself or use the [hacking CI scripts][hacking-ci-scripts] to provision an environment with DevStack similar to the one used for continuous integration.
108+
109+
#### Requirements
106110

107111
The file [`test/e2e/data/e2e_conf.yaml`](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/test/e2e/data/e2e_conf.yaml) and the test templates under [`test/e2e/data/infrastructure-openstack`](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/tree/main/test/e2e/data/infrastructure-openstack) reference several OpenStack resources which must exist before running the test:
108112

@@ -155,8 +159,38 @@ The file [`test/e2e/data/e2e_conf.yaml`](https://github.com/kubernetes-sigs/clus
155159
region_name: RegionOne
156160
```
157161
158-
You can also use [Hacking CI scripts](https://cluster-api-openstack.sigs.k8s.io/development/ci.html#devstack) to automatically create OpenStack environment.
162+
#### Create E2E test environment
163+
164+
You can easily create a test environment similar to the one used during continuous integration on OpenStack, AWS or GCE with the [hacking CI scripts][hacking-ci-scripts].
165+
166+
The entry point for the creation of the DevStack environment is the [create_devstack.sh][hack-ci-create-devstack] script, which executes specific scripts to create infrastructure on different clouds:
167+
168+
- AWS: [aws-project.sh][hack-ci-aws-project]
169+
- GCE: [gce-project.sh][hack-ci-gce-project]
170+
- OpenStack: [openstack.sh][hack-ci-openstack]
171+
172+
You can switch between these cloud providers, by setting the `RESOURCE_TYPE` environment variable to `aws-project`, `gce-project` or `openstack` respectively.
173+
174+
##### OpenStack
175+
176+
Configure the following environment variables for OpenStack:
159177

178+
```bash
179+
export RESOURCE_TYPE="openstack"
180+
export OS_CLOUD=<your cloud>
181+
export OPENSTACK_FLAVOR_controller=<flavor with >= 16 cores, 64GB RAM and 50GB storage>
182+
export OPENSTACK_FLAVOR_worker=<flavor with >= 8 cores, 32GB RAM and 50GB storage>
183+
export OPENSTACK_PUBLIC_NETWORK=<name of the external network>
184+
export OPENSTACK_SSH_KEY_NAME=<your ssh key-pair name>
185+
export SSH_PUBLIC_KEY_FILE=/home/user/.ssh/id_ed25519.pub
186+
export SSH_PRIVATE_KEY_FILE=/home/user/.ssh/id_ed25519
187+
```
188+
189+
and create the environment by running:
190+
191+
```bash
192+
./hack/ci/create_devstack.sh
193+
```
160194

161195
## Running E2E tests using rootless podman
162196

@@ -190,3 +224,11 @@ $ podman system service -t 0 &
190224
$ sudo rm /var/run/docker.sock
191225
$ sudo ln -s /run/user/$(id -u)/podman/podman.sock /var/run/docker.sock
192226
```
227+
228+
<!-- References -->
229+
230+
[hacking-ci-scripts]: https://cluster-api-openstack.sigs.k8s.io/development/ci.html#devstack
231+
[hack-ci-aws-project]: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/hack/ci/aws-project.sh
232+
[hack-ci-create-devstack]: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/hack/ci/create_devstack.sh
233+
[hack-ci-gce-project]: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/hack/ci/gce-project.sh
234+
[hack-ci-openstack]: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/hack/ci/openstack.sh

0 commit comments

Comments
 (0)