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.

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