You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.3 KiB

  1. # Offline deployment
  2. ## manage-offline-container-images.sh
  3. Container image collecting script for offline deployment
  4. This script has two features:
  5. (1) Get container images from an environment which is deployed online, or set IMAGES_FROM_FILE
  6. environment variable to get images from a file (e.g. temp/images.list after running the
  7. ./generate_list.sh script).
  8. (2) Deploy local container registry and register the container images to the registry.
  9. Step(1) should be done online site as a preparation, then we bring the gotten images
  10. to the target offline environment. if images are from a private registry,
  11. you need to set `PRIVATE_REGISTRY` environment variable.
  12. Then we will run step(2) for registering the images to local registry, or to an existing
  13. registry set by the `DESTINATION_REGISTRY` environment variable. By default, the local registry
  14. will run on port 5000. This can be changed with the `REGISTRY_PORT` environment variable
  15. Step(1) can be operated with:
  16. ```shell
  17. manage-offline-container-images.sh create
  18. ```
  19. Step(2) can be operated with:
  20. ```shell
  21. manage-offline-container-images.sh register
  22. ```
  23. ## generate_list.sh
  24. This script generates the list of downloaded files and the list of container images by `roles/kubespray-defaults/defaults/main/download.yml` file.
  25. Run this script will execute `generate_list.yml` playbook in kubespray root directory and generate four files,
  26. all downloaded files url in files.list, all container images in images.list, jinja2 templates in *.template.
  27. ```shell
  28. ./generate_list.sh
  29. tree temp
  30. temp
  31. ├── files.list
  32. ├── files.list.template
  33. ├── images.list
  34. └── images.list.template
  35. 0 directories, 5 files
  36. ```
  37. In some cases you may want to update some component version, you can declare version variables in ansible inventory file or group_vars,
  38. then run `./generate_list.sh -i [inventory_file]` to update file.list and images.list.
  39. ## manage-offline-files.sh
  40. This script will download all files according to `temp/files.list` and run nginx container to provide offline file download.
  41. Step(1) generate `files.list`
  42. ```shell
  43. ./generate_list.sh
  44. ```
  45. Step(2) download files and run nginx container
  46. ```shell
  47. ./manage-offline-files.sh
  48. ```
  49. when nginx container is running, it can be accessed through <http://127.0.0.1:8080/>.