-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add spegel distributed registry mirror #8977
Conversation
5c4eb23
to
f7bda60
Compare
We can check off ipv6 support as I have merged spegel-org/spegel#284. |
18656bf
to
8611079
Compare
Thanks Brandon. I am really happy to see such good progress on this one. I can help test this. If you need support convincing the team or the PMs, you can count my vote (and perhaps @adrianmoye's too) :) |
8611079
to
1529066
Compare
163225d
to
782e719
Compare
It's truly amazing the work you put into integrating spegel @brandond and so quickly, can't wait to try it out. ❤️ |
782e719
to
df32ea7
Compare
df32ea7
to
cc643d4
Compare
cc643d4
to
c498353
Compare
Thanks @brandond for the great work! I really appreciate it. This looks like the perfect solution for me, with pinning images (a feature I wasn't aware of) being the final point for my requirements. |
878f888
to
a1a8fba
Compare
I just learned about Spegel and tried out it out. Freaking amazing work! Looking forward to this! |
spegel exposes some useful metrics, will they be exposed in case of running embedded spegel? Cannot find anything related in PR |
It would be very helpful useful to have those metrics exposed, their grafana dashboard is quite nice for reviewing what's going on. |
Layer leases never did what we wanted anyways, and this is the new approved interface for ensuring that images do not get GCd Signed-off-by: Brad Davidson <[email protected]>
Moving it into config.Agent so that we can use or modify it outside the context of containerd setup Signed-off-by: Brad Davidson <[email protected]>
Fixes crash when killing agent while waiting for config from server Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Signed-off-by: Brad Davidson <[email protected]>
Proposed Changes
This embeds spegel, a distributed registry mirror, into the K3s supervisor. In addition to reducing traffic against upstream registries, this also allows airgap images preloaded onto one node to be transparently shared to other nodes as needed.
spegel consists of a registry API backed by the local containerd image store, and a distributed hash table that allows nodes to gossip about which images and blobs they have available.
The local registry mirror is injected into the containerd config as the first mirror endpoint, followed by the user-selected endpoints, and finally the default endpoint. If any node in the cluster has an image, it will be pulled from that node, instead of from the registry or registry mirror.
The embedded registry is enabled at a cluster level via a CLI flag. When enabled, all nodes will listen on port 5001 for P2P traffic, secured by a preshared key. Agents will have a new listener on port 6443 that hosts the registry endpoint. The registry API is served over HTTPS, and requires a valid client certificate for access.
This appears to add ~4.4MB to the size of the K3s release artifact.
Checklist:
Handled by upstream in Fix support for ipv6 spegel-org/spegel#284
spegel-org/spegel@main...k3s-io:spegel:k3s-main
Builds on:
Inspired by:
Resolves:
Use:
--embedded-registry
registries.yaml
on every node that you want to participate in the sharing of images. The registry does not need to have any endpoints, although it may. For example, this is a valid configuration:--disable-default-registry-endpoint
, in which case images will only be available via airgap tarball, distributed mirror, or user-configured mirror (in order of precendece)kubectl get --raw /api/v1/nodes/NODENAME/proxy/metrics | grep -F 'spegel_
Types of Changes
new feature
Verification
See above
Testing
E2e test added.
Linked Issues
User-Facing Change
Further Comments