# How-to update images in k0s airgap environment

**URL:** <https://forums.k8slens.dev/t/how-to-update-images-in-k0s-airgap-environment/2884>\
**Category:** All about k0s\
**Tags:** k0s\
**Created:** [February 23, 2024, 7:53am UTC](https://forums.k8slens.dev/t/how-to-update-images-in-k0s-airgap-environment/2884 "2024-02-23T07:53:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![biscout42](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@biscout42](https://forums.k8slens.dev/u/biscout42)\
**Post date:** [February 23, 2024, 7:53am UTC](https://forums.k8slens.dev/t/how-to-update-images-in-k0s-airgap-environment/2884/1 "2024-02-23T07:53:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![twieczorek](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/twieczorek/32/138_2.png) [@twieczorek](https://forums.k8slens.dev/u/twieczorek)\
**Post date:** [February 23, 2024, 8:17am UTC](https://forums.k8slens.dev/t/how-to-update-images-in-k0s-airgap-environment/2884/2 "2024-02-23T08:17:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![biscout42](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@biscout42](https://forums.k8slens.dev/u/biscout42)\
**Post date:** [February 23, 2024, 12:09pm UTC](https://forums.k8slens.dev/t/how-to-update-images-in-k0s-airgap-environment/2884/3 "2024-02-23T12:09:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![twieczorek](https://forums.k8slens.dev/user_avatar/forums.k8slens.dev/twieczorek/32/138_2.png) [@twieczorek](https://forums.k8slens.dev/u/twieczorek)\
**Post date:** [February 23, 2024, 12:20pm UTC](https://forums.k8slens.dev/t/how-to-update-images-in-k0s-airgap-environment/2884/4 "2024-02-23T12:20:00Z")

</div>

> [@biscout42](#):
>
> 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).

---

<div class="post-metadata">

**Author:** ![biscout42](https://forums.k8slens.dev/letter_avatar_proxy/v4/letter/b/2bfe46/32.png) [@biscout42](https://forums.k8slens.dev/u/biscout42)\
**Post date:** [February 23, 2024, 12:20pm UTC](https://forums.k8slens.dev/t/how-to-update-images-in-k0s-airgap-environment/2884/5 "2024-02-23T12:20:56Z")

</div>

> [@twieczorek](#):
>
> But the containers need to be restarted manually

Great, thanks a lot. That help!
