-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d7d872a
Pin images instead of locking layers with lease
brandond d24167a
Move registries.yaml load into agent config
brandond da52345
Propagate errors up from config.Get
brandond 22337d2
Add ADR for embedded registry
brandond 234a5f3
Add server CLI flag and config fields for embedded registry
brandond 17dfdb1
Add embedded registry implementation
brandond 6533a91
Add e2e test for embedded registry mirror
brandond File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Package spegel Distributed Registry Mirror | ||
|
||
Date: 2023-12-07 | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
Embedded registry mirror support has been on the roadmap for some time, to address multiple challenges: | ||
* Upstream registries may enforce pull limits or otherwise throttle access to images. | ||
* In edge scenarios, bandwidth is at a premium, if external access is available at all. | ||
* Distributing airgap image tarballs to nodes, and ensuring that images remain available, is an ongoing | ||
hurdle to adoption. | ||
* Deploying an in-cluster registry, or hosting a registry outside the cluster, put significant | ||
burden on administrators, and suffer from chicken-or-egg bootstrapping issues. | ||
|
||
An ideal embedded registry would have several characteristics: | ||
* Allow stateless configuration such that nodes can come and go at any time. | ||
* Integrate into existing containerd registry mirror support. | ||
* Integrate into existing containerd image stores such that an additional copy of layer data is not required. | ||
* Use existing cluster authentication mechanisms to prevent unauthorized access to the registry. | ||
* Operate with minimal added CPU and memory overhead. | ||
|
||
## Decision | ||
|
||
* We will embed spegel within K3s, and use it to host a distributed registry mirror. | ||
* The distributed registry mirror will be enabled cluster-wide via server CLI flag. | ||
* Selection of upstream registries to mirror will be implemented via the existing `registries.yaml` | ||
configuration file. | ||
* The registry API will be served via HTTPS on every node's private IP at port 6443. On servers this will | ||
use the existing supervisor listener; on agents a new listener will be created for this purpose. | ||
* The default IPFS/libp2p port of 5001 will be used for P2P layer discovery. | ||
* Access to the registry API and P2P network will require proof of cluster membership, enforced via | ||
client certificate or preshared key. | ||
* Hybrid/multicloud support is out of scope; when the distributed registry mirror is enabled, cluster | ||
members are assumed to be directly accessible to each other via their internal IP on the listed ports. | ||
|
||
## Consequences | ||
|
||
* The size of our self-extracting binary and Docker images increase by several megabytes. | ||
* We take on the support burden of keeping spegel up to date, and supporting its use within K3s. |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API will be only consumed locally (by the node), right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used both locally by containerd, and by spegel on other nodes when providing content for containerd. Spegel docs cover the actual flow from local containerd -> local spegel proxy -> remote spegel image store -> remote containerd image store.