How-to update images in k0s airgap environment

Hi there, I’m new to k0s and would like to learn how-to do image upgrade in case of k0s air gapped environment.

In particular, I have a k0s cluster, version v1.27.5+k0s.0, and airgap install. I have my bundle file in /var/lib/k0s/images/airgap.tar.

My assumption was: if I replace this file with new bundle and restart k0s, cluster will have new images. It didn’t work.

After reading docs and googling a bit I wasn’t able to find an answer. Could you help me and guide how could one update container images in airgap environment with k0s?

The airgap image bundles are imported into containerd, i.e. the images don’t need to be pulled from any registry, but are already ready to use. However, you will also need to change the cluster configuration to actually use these images, i.e. the image names/versions in your k0s config and other pod specs.

Thanks, @twieczorek , for quick reply. I figured out, that the restart I did via k0s stop and k0s start didn’t work as expected. After proper controller restart I was able to see new image.

One follow-up question: I use latest tag in my container configuration, and new airgap suppose to have new image with the same tag. Will containerd update image in this case or there is some cache which I should invalidate?

K0s will import images as is from the airgap image bundle into containerd. If the image inside the airgap bundle is tagged with latest, the image should be imported and the tag updated accordingly. But the containers need to be restarted manually, since Kubernetes will only do that if it detects difference in the state, but there isn’t (latest is the same as latest in the end, even if the image hash changed; kubelet won’t check for that).

Great, thanks a lot. That help!