-
-
Notifications
You must be signed in to change notification settings - Fork 512
Description
Is your feature request related to a problem or a Pull Request
Hi k3d team,
This is a feature request about registry sub-command.
I tried k3d recently and found k3d could create and manage registry node, connect the clusters to registries automatically, it's great.
But everytime I rebuild the cluster, k3d need to pull the images of cluster from upstream, due to poor network conditions, it takes a long time to be ready.
I tried to find if there is a way to make local cache with the k3d managed registry and configure the cluster pull from the cache, it seems that k3d could only create a simple registry now, but not a pull-through cache.
Scope of your request
New flags for k3d registry create sub-commands
Describe the solution you'd like
I am thinking that if we could introduce new flags for k3d registry create to create a pull-through registry.
Describe alternatives you've considered
k3d registry create \
--proxy-remote-url <remote_url> \
--proxy_username <username> \
--proxy_password <password> \
-v <src_path>:<dst_path> \
...
Demo:
- Create a pull-through registry
k3d registry create docker-io \
-p 127.0.0.1:5000 \
--proxy-remote-url https://registry-1.docker.io \
-v ~/.local/share/docker-io-registry:/var/lib/registry
- Create
registry.yaml
mirrors:
"docker.io":
endpoint:
- http://k3d-docker-io:5000
- Create cluster and use the pull-through cache
k3d cluster create cluster01 --registry-use k3d-docker-io:5000 --registry-config registry.yml
- After the cluster01 ready, create another cluster with the same registry or rebuild the cluster, it would be fast.
k3d cluster create cluster02 --registry-use k3d-docker-io:5000 --registry-config registry.yml
I see there are already options about registry proxy but they are not used in the registry creation.
I made a fork(ethinx@1160b23) about the above idea, it's a draft and please take a look if it's appropriate.