Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pinning from outdated k0s-imported OCI images #4433

Open
twz123 opened this issue May 16, 2024 · 4 comments · May be fixed by #4500
Open

Remove pinning from outdated k0s-imported OCI images #4433

twz123 opened this issue May 16, 2024 · 4 comments · May be fixed by #4500

Comments

@twz123
Copy link
Member

twz123 commented May 16, 2024

When k0s imports OCI images into containerd, it pins them to prevent them from being garbage collected. If the OCI images are replaced regularly over time, e.g. if an airgapped cluster is regularly upgraded, these images will pile up in containerd's image filesystem, potentially leading to disk pressure at some point.

K0s should be smart about this. It should unpin imported images that are no longer in the import folder. This will allow containerd to remove any old images once they are no longer in use.

@ricardomaraschini
Copy link
Contributor

ricardomaraschini commented May 24, 2024

I am more than happy to work on this if no one else is acting yet.

@jnummelin
Copy link
Collaborator

❤️

One idea I had for this was to label each image with the filename where it was imported from. That way we can delete images which no more has bundle file for it. Haven't spent much time thinking about this so there might be some gaps in my idea... 😂

@twz123
Copy link
Member Author

twz123 commented May 24, 2024

I am more than happy to work on this if no one else is acting yet.

Yes, please! Go ahead 🚀

I was thinking about adding some extra labels to the imported images, so that k0s can identify which ones have been imported previously. Then it could remove the pin label from those previously imported images that aren't part of any of the bundles in the bundle dir anymore. Or sth. along those lines. WDYT?

@ricardomaraschini ricardomaraschini linked a pull request May 27, 2024 that will close this issue
16 tasks
@ricardomaraschini
Copy link
Contributor

I had designed a possible solution using Labels as proposed. Let me know what you think: #4500

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants