|
14 | 14 | - [Requirements](#requirements)
|
15 | 15 | - [Create E2E test environment](#create-e2e-test-environment)
|
16 | 16 | - [OpenStack](#openstack)
|
| 17 | + - [DevStack](#devstack) |
17 | 18 | - [Running E2E tests using rootless podman](#running-e2e-tests-using-rootless-podman)
|
18 | 19 | - [Host configuration](#host-configuration)
|
19 | 20 | - [Running podman system service to emulate docker daemon](#running-podman-system-service-to-emulate-docker-daemon)
|
@@ -195,6 +196,111 @@ and create the environment by running:
|
195 | 196 | ./hack/ci/create_devstack.sh
|
196 | 197 | ```
|
197 | 198 |
|
| 199 | +##### DevStack |
| 200 | + |
| 201 | +Here's a few notes to setup a DevStack environment and debug ressources (tested on `m3.small` from Equinix Metal: https://deploy.equinix.com/product/servers/m3-small/) |
| 202 | + |
| 203 | +###### Server side |
| 204 | + |
| 205 | +As a root user, install and configure DevStack: |
| 206 | + |
| 207 | +``` |
| 208 | +# useradd -s /bin/bash -d /opt/stack -m stack |
| 209 | +# chmod +x /opt/stack |
| 210 | +# echo "stack ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/stack |
| 211 | +# sudo -u stack -i |
| 212 | +$ git clone https://opendev.org/openstack/devstack |
| 213 | +$ cd devstack |
| 214 | +$ cat > local.conf <<EOF |
| 215 | +[[local|localrc]] |
| 216 | +ADMIN_PASSWORD=!!! CHANGE ME !!! |
| 217 | +DATABASE_PASSWORD=\$ADMIN_PASSWORD |
| 218 | +RABBIT_PASSWORD=\$ADMIN_PASSWORD |
| 219 | +SERVICE_PASSWORD=\$ADMIN_PASSWORD |
| 220 | +
|
| 221 | +GIT_BASE=https://opendev.org |
| 222 | +# Enable Logging |
| 223 | +LOGFILE=$DEST/logs/stack.sh.log |
| 224 | +VERBOSE=True |
| 225 | +LOG_COLOR=True |
| 226 | +enable_service rabbit |
| 227 | +enable_plugin neutron $GIT_BASE/openstack/neutron |
| 228 | +# Octavia supports using QoS policies on the VIP port: |
| 229 | +enable_service q-qos |
| 230 | +enable_service placement-api placement-client |
| 231 | +# Octavia services |
| 232 | +enable_plugin octavia $GIT_BASE/openstack/octavia master |
| 233 | +enable_plugin octavia-dashboard $GIT_BASE/openstack/octavia-dashboard |
| 234 | +enable_plugin ovn-octavia-provider $GIT_BASE/openstack/ovn-octavia-provider |
| 235 | +enable_plugin octavia-tempest-plugin $GIT_BASE/openstack/octavia-tempest-plugin |
| 236 | +enable_service octavia o-api o-cw o-hm o-hk o-da |
| 237 | +# Cinder |
| 238 | +enable_service c-api c-vol c-sch |
| 239 | +EOF |
| 240 | +$ ./stack.sh |
| 241 | +``` |
| 242 | + |
| 243 | +If you want to enable web-download (i.e import images from URL): |
| 244 | +``` |
| 245 | +# /etc/glance/glance-api.conf |
| 246 | +show_multiple_locations = True |
| 247 | +
|
| 248 | +# ./horizon/openstack_dashboard/defaults.py |
| 249 | +IMAGE_ALLOW_LOCATIONS = True |
| 250 | +
|
| 251 | +# /etc/glance/glance-image-import.conf |
| 252 | +[image_import_opts] |
| 253 | +image_import_plugins = ['image_decompression'] |
| 254 | +
|
| 255 | +$ sudo systemctl restart [email protected] apache2 |
| 256 | +``` |
| 257 | + |
| 258 | +With this dev setup, it might be useful to enable DHCP for the public subnet: |
| 259 | +Admin > Network > Networks > `public` > Subnets > `public-subnet` > Edit Subnet > Subnet Details > :ballot_box_with_check: Enable DHCP + Add DNS |
| 260 | + |
| 261 | +###### CAPO side |
| 262 | + |
| 263 | +To work with this setup, it takes an update of the `test/e2e/data/e2e_conf.yaml` file. (NOTE: You can decide to update the m1.small flavor to avoid changing it) |
| 264 | + |
| 265 | +```diff |
| 266 | +diff --git a/test/e2e/data/e2e_conf.yaml b/test/e2e/data/e2e_conf.yaml |
| 267 | +index 0d66e1f2..a3b2bd78 100644 |
| 268 | +--- a/test/e2e/data/e2e_conf.yaml |
| 269 | ++++ b/test/e2e/data/e2e_conf.yaml |
| 270 | +@@ -136,7 +136,7 @@ variables: |
| 271 | + CNI: "../../data/cni/calico.yaml" |
| 272 | + CCM: "../../data/ccm/cloud-controller-manager.yaml" |
| 273 | + EXP_CLUSTER_RESOURCE_SET: "true" |
| 274 | +- OPENSTACK_BASTION_IMAGE_NAME: "cirros-0.6.1-x86_64-disk" |
| 275 | ++ OPENSTACK_BASTION_IMAGE_NAME: "cirros-0.5.2-x86_64-disk" |
| 276 | + OPENSTACK_BASTION_MACHINE_FLAVOR: "m1.tiny" |
| 277 | + OPENSTACK_CLOUD: "capo-e2e" |
| 278 | + OPENSTACK_CLOUD_ADMIN: "capo-e2e-admin" |
| 279 | +@@ -144,10 +144,10 @@ variables: |
| 280 | + OPENSTACK_CLOUD_YAML_FILE: '../../../../clouds.yaml' |
| 281 | + OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR: "m1.medium" |
| 282 | + OPENSTACK_DNS_NAMESERVERS: "8.8.8.8" |
| 283 | +- OPENSTACK_FAILURE_DOMAIN: "testaz1" |
| 284 | +- OPENSTACK_FAILURE_DOMAIN_ALT: "testaz2" |
| 285 | ++ OPENSTACK_FAILURE_DOMAIN: "nova" |
| 286 | ++ OPENSTACK_FAILURE_DOMAIN_ALT: "nova" |
| 287 | + OPENSTACK_IMAGE_NAME: "focal-server-cloudimg-amd64" |
| 288 | +- OPENSTACK_NODE_MACHINE_FLAVOR: "m1.small" |
| 289 | ++ OPENSTACK_NODE_MACHINE_FLAVOR: "m1.medium" |
| 290 | +``` |
| 291 | + |
| 292 | +Before running a test: |
| 293 | +* start `sshuttle` (https://github.com/sshuttle/sshuttle) to setup the network between the host and the devstack instance correctly. |
| 294 | +``` |
| 295 | +sshuttle -r stack@<devstack-server-ip> 172.24.4.0/24 -l 0.0.0.0 |
| 296 | +``` |
| 297 | +* import the tested image in DevStack by matching the name defined in `e2e_conf.yaml` (`OPENSTACK_FLATCAR_IMAGE_NAME` or `OPENSTACK_IMAGE_NAME`) |
| 298 | +
|
| 299 | +To run a specific test, it's possible to fill this variable `E2E_GINKGO_FOCUS`, if you want to SSH into an instance to debug it, it's possible to proxy jump via the bastion and to use the SSH key generated by Nova, for example with Flatcar: |
| 300 | +``` |
| 301 | +ssh -J [email protected] -i ./ _artifacts/ssh/cluster-api-provider-openstack-sigs-k8s-io [email protected] |
| 302 | +``` |
| 303 | +
|
198 | 304 | ## Running E2E tests using rootless podman
|
199 | 305 |
|
200 | 306 | You can use unprivileged podman to:
|
|
0 commit comments