You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/src/development/development.md
+100
Original file line number
Diff line number
Diff line change
@@ -42,3 +42,103 @@ After generating `infrastructure-components.yaml`, replace the `us.gcr.io/k8s-ar
42
42
## Developing with Tilt
43
43
44
44
We have support for using [Tilt](https://tilt.dev/) for rapid iterative development. Please visit the [Cluster API documentation on Tilt](https://master.cluster-api.sigs.k8s.io/developer/tilt.html) for information on how to set up your development environment.
45
+
46
+
## Running E2E tests locally
47
+
48
+
You can run the E2E tests locally with:
49
+
50
+
```bash
51
+
make test-e2e OPENSTACK_CLOUD_YAML_FILE=/path/to/clouds.yaml OPENSTACK_CLOUD=mycloud
52
+
```
53
+
54
+
where `mycloud` is an entry in `clouds.yaml`.
55
+
56
+
The E2E tests:
57
+
* Build a CAPO image from the local working directory
58
+
* Create a kind cluster locally
59
+
* Deploy downloaded CAPI, and locally-build CAPO to kind
60
+
* Create an e2e namespace per-test on the kind cluster
61
+
* Deploy cluster templates to the test namespace
62
+
* Create test clusters on the target OpenStack
63
+
64
+
### Support for clouds using SSL
65
+
66
+
If your cloud requires a cacert you must also pass this to make via `OPENSTACK_CLOUD_CACERT_B64`, i.e.:
67
+
68
+
```bash
69
+
make test-e2e OPENSTACK_CLOUD_YAML_FILE=/path/to/clouds.yaml OPENSTACK_CLOUD=my_cloud \
CAPO deployed in the local kind cluster will automatically pick up a `cacert` defined in your `clouds.yaml` so you will see servers created in OpenStack without specifying `OPENSTACK_CLOUD_CACERT_B64`. However, the cacert won't be deployed to those servers, so kubelet will fail to start.
74
+
75
+
### Support for clouds with multiple external networks
76
+
77
+
If your cloud contains only a single external network CAPO will automatically select that network for use by a deployed cluster. However, if there are multiple external networks CAPO will log an error and fail to create any machines. In this case you must pass the id of an external network to use explicitly with `OPENSTACK_EXTERNAL_NETWORK_ID`, i.e.:
78
+
79
+
```bash
80
+
make test-e2e OPENSTACK_CLOUD_YAML_FILE=/path/to/clouds.yaml OPENSTACK_CLOUD=my_cloud \
The file `test/e2e/data/e2e_conf.yaml` and the test templates under `test/e2e/data/infrastructure-openstack` reference several OpenStack resources which must exist before running the test:
101
+
102
+
* Glance images
103
+
*`cirros-0.5.1-x86_64-disk`
104
+
* Download from https://docs.openstack.org/image-guide/obtain-images.html
105
+
*`ubuntu-2004-kube-v1.18.15`
106
+
* Download from https://storage.googleapis.com/artifacts.k8s-staging-capi-openstack.appspot.com/test/ubuntu/2021-03-27/ubuntu-2004-kube-v1.18.15.qcow2
107
+
* Or generate using the `images/capi` directory from https://github.com/kubernetes-sigs/image-builder
108
+
* Flavors
109
+
*`m1.medium`: used by control plane
110
+
*`m1.small`: used by workers
111
+
*`m1.tiny`: used by bastion
112
+
113
+
## Running E2E tests using rootless podman
114
+
115
+
You can use unprivileged podman to:
116
+
* Build the CAPO image
117
+
* Deploy the kind cluster
118
+
119
+
To do this you need to configure the host appropriately and pass `PODMAN=1` to make, i.e.:
120
+
121
+
```bash
122
+
make test-e2e OPENSTACK_CLOUD_YAML_FILE=/path/to/clouds.yaml OPENSTACK_CLOUD=my_cloud \
123
+
PODMAN=1
124
+
```
125
+
126
+
### Host configuration
127
+
128
+
Firstly, you must be using kernel >=5.11. Fedora 34 is the oldest distribution with this kernel.
129
+
130
+
You *MUST* configure systemd and iptables as described in https://kind.sigs.k8s.io/docs/user/rootless/. There is no need to configure cgroups v2 as Fedora uses this by default.
131
+
132
+
You must install the `podman-docker` package to emulate the docker cli tool. However, this is not sufficient on its own as described below.
133
+
134
+
### Running podman system service to emulate docker daemon
135
+
136
+
While kind itself supports podman, the cluster-api test framework does not. This framework is used by the CAPO tests to push test images into the kind cluster. Unfortunately the cluster-api test framework explicitly connects to a running docker daemon, so cli emulation is not sufficient for compatibility. This issue is tracked in https://github.com/kubernetes-sigs/cluster-api/issues/5146, and the following workaround can be ignored when this is resolved.
137
+
138
+
podman includes a 'system service' which emulates docker. For the tests to work, this service must be running and listening on a unix socket at `/var/run/docker.sock`. You can achieve this with:
0 commit comments