Working with the mirror after installation
Uploading new versions to the mirror, delivering updates to clusters.
Once the platform is installed in a closed loop, the mirror is used to deliver updates. When a new version of the platform is released, it is necessary to update the mirror, then the clusters.
Migration from old mirror
When migrating from a previous version of the mirror module (old Docker/Podman, different location):
- Stop the old mirror and remove the old container runtime if necessary (eg
rm /usr/local/bin/podmanor similar for your installation). - Initialize the new mirror (
stm initorstm bundle make/stm make) and, if necessary, specify the certificates of the old mirror:--cert-fileand--privkey-filewith paths to files from the old host. - Download the required versions of the platform from a bundle, from a repository, or from a manually assembled bundle. The list of versions in the old mirror can be found in the file
$OLD_MIRROR_PATH/images/repo/bin/versions.json. - For nodes on deb distributions, after changing the mirror on the nodes, run
systemctl restart shturvaldand check the update of the repositories (apt update).
Removing a release from the mirror
To remove a platform version from the mirror (to free up space or remove an outdated release):
stm delete --version=2.12.0,2.11.0
Specify the versions to be deleted, separated by commas. For correct deletion, metadata is required (files shturval_offline/VERSION/*.json in the repository); When using old bundles or stm younger than 1.3, you may need to update stm and re-download at least one release. Deleting does not automatically free up disk space: in Nexus you need to run the Compact blob store task (Administration → Tasks) for the corresponding blob store (docker, shturval_bin_public, shturval_helm, etc.).
Working with patches
The patch allows you to add missing packages or images to the mirror without rebuilding the bundle and without completely updating the mirror.
Building the patch (on a machine with access to the Shturval repository): prepare a config similar to config/patch.yaml (list of repositories and packages/images) and run stm patch make --license=XXXX-XXXX-XXXX. An archive of the form shturval-mirror-patch-TIMESTAMP.tgz will be created.
Applying the patch: in the directory with the initialized mirror, create the shturval-patch directory, place the archive in it and execute stm patch apply. After application, the archive can be deleted.
Ways to update a mirror
- Manual download of the bundle - the bundle of the new version is uploaded to a file hosting service, you download and upload to the mirror
- Pipeline - update without manual download (instructions in the Service Desk knowledge base)
Step by step update procedure
Step 1: Receive and unpack the bundle
Download the bundle from the link from the development team. Na hoOn the mirror ste create a directory and unpack:
mkdir newbundle && cd newbundle
cp /path/to/downloaded/bundle.tar.gz .
tar -zxvf bundle_name.tar.gz
cd .. # to the directory with the current mirror
Step 2: Update the stm utility
From the bundle directory:
cp stm path_to_mirror/ # replace stm with the version from the bundle
cp -rp distr path_to_mirror # update mirror configuration (Nginx, rewrite rules)
cd path_to_mirror # switch to the mirror directory
./stm restart # restart mirror services with the new stm and distr
Step 3: Upload to mirror
Run in the directory where the current mirror is located:
stm bundle load --path=./newbundle/shturval-bundle
Step 4: Restart ShturvalUpdateChannel
After updating the mirror, it is required to restart the custom resource ShturvalUpdateChannel in each cluster (management and client) for which the update is planned. Without this, the new version will appear in at least 6 hours (reconciliation).
Via kubectl:
kubectl label ShturvalUpdateChannel shturval-update --namespace shturval-update-system example=restart
The example=restart parameter is a custom label for the reconciliation trigger.
Via GUI:
- Administration → Custom Resources →
update.shturval.tech→ ShturvalUpdateChannel - Open the resource
shturval-update - Check → Save (no changes)
The new version will be available in 5-10 minutes.
Step 5: Updating Clusters
The order is management cluster first, then client clusters.
More details: Update procedure, Start and update stages.
Conditionally closed loop (Internet on the mirror)
If the mirror host has access to r.shturval.tech:
stm download --version=2.14.0
Then follow steps 4 and 5 above.