kubespray/contrib/offline
Arthur Outhenin-Chalandre 25cb90bc2d
Upgrade ansible (#10190)
* project: update all dependencies including ansible

Upgrade to ansible 7.x and ansible-core 2.14.x. There seems to be issue
with ansible 8/ansible-core 2.15 so we remain on those versions for now.
It's quite a big bump already anyway.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* tests: install aws galaxy collection

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* ansible-lint: disable various rules after ansible upgrade

Temporarily disable a bunch of linting action following ansible upgrade.
Those should be taken care of separately.

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve deprecated-module ansible-lint error

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve no-free-form ansible-lint error

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve schema[meta] ansible-lint error

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve schema[playbook] ansible-lint error

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve schema[tasks] ansible-lint error

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve risky-file-permissions ansible-lint error

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve risky-shell-pipe ansible-lint error

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: remove deprecated warn args

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: use fqcn for non builtin tasks

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: resolve syntax-check[missing-file] for contrib playbook

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: use arithmetic inside jinja to fix ansible 6 upgrade

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

---------

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
2023-06-26 03:15:45 -07:00
..
README.md Split defaults main file (#10121) 2023-06-22 02:19:40 -07:00
docker-daemon.json Add manage-offline-container-images.sh (#7024) 2021-01-06 08:05:52 -08:00
generate_list.sh Split defaults main file (#10121) 2023-06-22 02:19:40 -07:00
generate_list.yml Upgrade ansible (#10190) 2023-06-26 03:15:45 -07:00
manage-offline-container-images.sh [registry] Switch registry to use registry.k8s.io 2022-06-08 14:12:22 +02:00
manage-offline-files.sh fix manage-offline-files script - wrong path (#9886) 2023-05-28 21:27:42 -07:00
nginx.conf add manage offline files script (#8956) 2022-06-21 03:49:43 -07:00
registries.conf Add manage-offline-container-images.sh (#7024) 2021-01-06 08:05:52 -08:00

README.md

Offline deployment

manage-offline-container-images.sh

Container image collecting script for offline deployment

This script has two features: (1) Get container images from an environment which is deployed online. (2) Deploy local container registry and register the container images to the registry.

Step(1) should be done online site as a preparation, then we bring the gotten images to the target offline environment. if images are from a private registry, you need to set PRIVATE_REGISTRY environment variable. Then we will run step(2) for registering the images to local registry.

Step(1) can be operated with:

manage-offline-container-images.sh   create

Step(2) can be operated with:

manage-offline-container-images.sh   register

generate_list.sh

This script generates the list of downloaded files and the list of container images by roles/download/defaults/main/main.yml file.

Run this script will execute generate_list.yml playbook in kubespray root directory and generate four files, all downloaded files url in files.list, all container images in images.list, jinja2 templates in *.template.

./generate_list.sh
tree temp
temp
├── files.list
├── files.list.template
├── images.list
└── images.list.template
0 directories, 5 files

In some cases you may want to update some component version, you can declare version variables in ansible inventory file or group_vars, then run ./generate_list.sh -i [inventory_file] to update file.list and images.list.

manage-offline-files.sh

This script will download all files according to temp/files.list and run nginx container to provide offline file download.

Step(1) generate files.list

./generate_list.sh

Step(2) download files and run nginx container

./manage-offline-files.sh

when nginx container is running, it can be accessed through http://127.0.0.1:8080/.