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

Auto-import images into the embedded registry while k3s is running #9759

Closed
r65535 opened this issue Mar 20, 2024 · 6 comments
Closed

Auto-import images into the embedded registry while k3s is running #9759

r65535 opened this issue Mar 20, 2024 · 6 comments
Assignees

Comments

@r65535
Copy link

r65535 commented Mar 20, 2024

Is your feature request related to a problem? Please describe.
k3s can load a bunch of resources from disk:

  • k8s manifests from /var/lib/rancher/k3s/server/manifests
  • Helm chart tgz can be hosted from /var/lib/rancher/k3s/server/static/charts
  • k3s required oci images from /var/lib/rancher/k3s/agent/images/k3s-airgap-images-amd64.tar.zst

With the new embedded registry, it'd be nice to also have a directory that can auto-load in miscellaneous OCI images (similar to k3s-airgap-images-amd64.tar.zst, but for arbitrary images). Especially in an edge/airgapped environment.

Describe alternatives you've considered
A crontab that finds files in a local directory and k3s ctr images import each TAR file 😓

@brandond
Copy link
Member

brandond commented Mar 20, 2024

The Spegel embedded registry mirror only supports mirroring things that can be loaded into containerd's image store. It has no store of its own. Containerd does not, as far as I know, support storing arbitrary OCI artifacts in its image store.

Feel free to open an issue at https://github.com/XenitAB/spegel and/or https://github.com/containerd/containerd - once they support it, we can too.

@github-project-automation github-project-automation bot moved this from New to Done Issue in K3s Development Mar 20, 2024
@brandond
Copy link
Member

Or perhaps I'm misunderstanding what you mean by "miscellaneous" / "arbitrary" OCI images. Are you just asking for periodic re-import of tarballs from the images directory, instead of only importing them on startup?

That's been asked for in the past, but hasn't been prioritized. Homebrewing something with ctr -n k8s.io image import is probably your best bet.

@r65535
Copy link
Author

r65535 commented Mar 20, 2024

As an example, I want to deploy bitnami/zookeeper to k3s in an airgapped environment.

  • I can host the helm tgz in /var/lib/rancher/k3s/server/static/charts
  • I can auto-deploy the helm chart using a manifest HelmChart CRD in /var/lib/rancher/k3s/server/manifests

But I can't load the zookeeper.tar containing the container image into the new embedded registry, without manually running k3s ctr images import zookeeper.tar. It'd be great if I could drop in that zookeeper.tar to a directory on the k3s server, and it auto-loads that image into the registry

@brandond
Copy link
Member

Thanks for the additional context. I'll leave this on the backlog.

@brandond brandond reopened this Mar 20, 2024
@brandond brandond added this to the Backlog milestone Mar 20, 2024
@brandond brandond moved this to Feature Requests in K3s Backlog Mar 20, 2024
@harsimranmaan
Copy link
Contributor

Autoloading approach can also help with managing image load times by deferring image imports for #9242

@VestigeJ
Copy link

Validated in each minor issue #11559 (comment)

@github-project-automation github-project-automation bot moved this from To Test to Done Issue in K3s Development Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

6 participants