Upgrading MetalSoft in air-gapped environments
In an air-gapped environment the Global Controller and the Site Controller cannot pull new images from the MetalSoft registry. MetalSoft supplies offline upgrade packages instead, which you copy to the controllers manually:
gcimages.tar.gz- the Global Controller imagesmanifests.tar.gz- the Global Controller Kubernetes manifestsscimages.tar.gz- the Site Controller images
The Global Controller steps below are written for the OVA deployment.
Upgrading the Global Controller
Section titled “Upgrading the Global Controller”1. Import the images
Section titled “1. Import the images”Copy gcimages.tar.gz and manifests.tar.gz to the Global Controller, then import the images:
gunzip gcimages.tar.gzctr image import gcimages.tar2. Update the manifests
Section titled “2. Update the manifests”Back up the current manifests in /root/manifests, then extract the new ones over them.
cp -a /root/manifests /root/manifests.bak-$(date +%Y%m%d)cd /root/manifeststar -xvzf /path/to/manifests.tar.gz -C /root/manifests3. Run the upgrade script
Section titled “3. Run the upgrade script”From the manifests folder, run upgrade.sh from the scripts folder. To see the available options:
./scripts/upgrade.sh -hExample:
./scripts/upgrade.sh -n mynamespaceBefore applying the new manifests, the script backs up the MySQL databases (except the system schemas and mysql_audit_raw), one mysqldatabase_<db>_<namespace>.sql.gz file per database, to:
/var/backups/metalsoft/<namespace>/<date>-pre_upgrade_mysqldump/Use -b <folder> to change the base folder (/var/backups/metalsoft), or -S to skip the backup.
4. Monitor the upgrade
Section titled “4. Monitor the upgrade”Wait until all pods are Running:
kubectl -n mynamespace get podsAlternative: OVA helper scripts
Section titled “Alternative: OVA helper scripts”Recent OVA versions also ship helper scripts that import the images and retag the manifests. Transfer the provided tar.gz files onto the Global Controller VM, put them into /root/k8s-images, and use the helper script there to import the images:
In recent versions of OVA, you can use:
./prepare-offline license.tar.gzIf that fails, use the following:
gunzip latest.tar.gz./prepare-offline latest.tarThis will import the latest.tar (which might hold 1 or more images for import).
Alternatively (manual process), import the images using the following command for each tar file:
ctr image import latest.tarOnce the images are imported, update the image tags in the manifests:
cd /root/manifestsmetalsoft-update-k8s-tag <newtag>So, if you are upgrading to v7.3.0, you would run:
metalsoft-update-k8s-tag v7.3.0This command, available in recent versions of OVA, automatically detects the current version from the manifests and updates the files to the new version.
Then apply the manifests:
kubectl apply -f .Upgrading the Site Controller
Section titled “Upgrading the Site Controller”1. Load the images
Section titled “1. Load the images”Copy scimages.tar.gz to the Site Controller and load it:
docker load -i scimages.tar.gzOlder versions of docker cannot load a .tar.gz directly. In that case, use:
gunzip scimages.tar.gzdocker load -i scimages.tar2. Update the image tags and restart the agents
Section titled “2. Update the image tags and restart the agents”cd /opt/metalsoft/agents# edit .env or docker-compose.yaml and update the tags of the images to the new version# then:docker compose up -d3. Verify
Section titled “3. Verify”# check running docker images:docker ps# check the logs of ms-agent:docker logs -f ms-agent --tail 50Pulling selected images yourself
Section titled “Pulling selected images yourself”If you need to upgrade only specific images, you can pull them from a machine with internet access and transfer them manually. Use the registry credentials provided by MetalSoft.
Global Controller
Section titled “Global Controller”Pull the image (ctr prompts for the password):
ctr images pull --platform linux/amd64 -u REGISTRY_USER registry.metalsoft.dev/gc/license:v7.0Save the locally pulled image to a .tar file:
ctr image export --platform linux/amd64 --skip-manifest-json /root/k8s-images/license.tar registry.metalsoft.dev/gc/license:v7.0Transfer the files onto the Global Controller, preferably into /root/k8s-images, and import each tar file:
ctr image import license.tarSite Controller
Section titled “Site Controller”Log into the MetalSoft registry, providing the username and password supplied by MetalSoft:
docker login registry.metalsoft.devPull the image:
docker pull registry.metalsoft.dev/sc/ms-agent:v7.0Save the locally pulled image to a .tar file:
docker save -o ms-agent.tar registry.metalsoft.dev/sc/ms-agent:v7.0Transfer the file onto the Site Controller and run the following from the folder you copied the tar to:
docker load -i ms-agent.tar