|
| 1 | +# Automatic Template Generation for CAPI Driver |
| 2 | + |
| 3 | +1. `git cherry-pick XXXXXX` if necessary (will replace this with final commit hash before this PR is merged) |
| 4 | +2. change `openstack_images` list to `glance images` in `etc/openstack/openstack-config.yml` if necessary |
| 5 | +3. ensure that `openstack_images` looks like: |
| 6 | +``` |
| 7 | +# Images to be uploaded |
| 8 | +openstack_images: "{{ glance_images + kubernetes_images }}" |
| 9 | +``` |
| 10 | +4. source the openstack-config venv you have set up |
| 11 | +5. source the rc.sh file that points to the appropriate cloud, or provide a `clouds.yaml` under `./tools/merge_config` |
| 12 | +6. ensure `wget`, `python-octaviaclient` and `python-magnumclient` are installed |
| 13 | +7. If you have existing `openstack_container_clusters_templates` defined, move them to `etc/openstack/container-clusters.yml` |
| 14 | +8. run `./tools/merge_config/bin/run` |
| 15 | +9. check output at `etc/openstack-config/container-clusters.yml` |
| 16 | +10. If it all checks out, run: |
| 17 | +``` |
| 18 | +tools/openstack-config -p ansible/openstack-container-clusters.yml -- --vault-password-file ~/.vault-secret -e@etc/openstack-config/container-clusters.yml |
| 19 | +``` |
| 20 | +Or include the same `-e@etc/openstack-config/container-clusters.yml` when you run the entire openstack-config suite. |
| 21 | + |
| 22 | +This must be ran before `os-images` is, if any kubernetes images/templates are being hidden/retired, because the cluster template cannot be hidden after the corresponding image is hidden. |
| 23 | + |
| 24 | +If you run the above command, you can run: |
| 25 | +``` |
| 26 | +tools/openstack-config -p ansible/openstack-images.yml -- --vault-password-file ~/.vault-secret -e@etc/openstack-config/container-clusters.yml |
| 27 | +``` |
| 28 | +afterwards, to upload/hide any of the kubernetes images. |
| 29 | + |
| 30 | +Note: If you run out of space to store images on the control host, you may need to run this in sections - comment out blocks of images, making sure to remove any cached images under `~/openstack-config/ansible/openstack-config-image-cache/` before moving onto the next block. |
| 31 | + |
| 32 | +Note: If the image cache has been cleared (i.e. the old images being set to hidden no longer exist in the cache), then `openstack.cloud.image` will not recognise that it is the same image and will upload a new one, so you should comment these images out from the list. |
| 33 | + |
| 34 | +Note: Container template hiding does not no-op, due to the current state of the magnum API. If the template is already hidden and you rerun this, you will get the error `ClusterTemplate 4ce13776-da1e-42c9-b6f3-1249363d7a4e is referenced by one or multiple clusters (HTTP 400)` |
| 35 | +You may also get an error like `Image ubuntu-focal-kube-v1 (HTTP 400)` , which is because the image has been hidden. If your template is already hidden, this is not a problem, but if it isn't hidden, you will need to unhide the images before the template hiding can run. |
0 commit comments