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

[registry] support create pull-through cache registry #1075

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

ethinx
Copy link
Contributor

@ethinx ethinx commented Jun 6, 2022

What

Allow k3d create pull-through cache registry

Why

for #1070

Implications

New feature, there should not be any breaking change.

k3d registry create \
  --proxy-remote-url <remote_url> \
  --proxy_username <username> \
  --proxy_password <password> \
  -v <src_path>:<dst_path> \
  ...

Demo:

  1. 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
  1. Create registry.yaml
mirrors:
  "docker.io":
    endpoint:
      - http://k3d-docker-io:5000
  1. Create cluster and use the pull-through cache
k3d cluster create cluster01 --registry-use k3d-docker-io:5000 --registry-config registry.yml
  1. 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

@iwilltry42
Copy link
Member

iwilltry42 commented Jun 6, 2022

Thanks for this PR @ethinx ! 🙏
Code looks good on first glance.
Would you mind adding some documentation? It'd be good enough if you give an example containing all options in the description of this PR. In a follow-up PR one of us can add the actual documentation for k3d.io and also potentially add related options to the config file 👍

EDIT: nevermind, just copied it from your issue text 👍

@iwilltry42 iwilltry42 added this to the v5.5.0 milestone Jun 6, 2022
@iwilltry42 iwilltry42 added the enhancement New feature or request label Jun 6, 2022
@iwilltry42
Copy link
Member

@all-contributors please add @ethinx for code

@allcontributors
Copy link
Contributor

@iwilltry42

I've put up a pull request to add @ethinx! 🎉

@iwilltry42 iwilltry42 self-requested a review June 6, 2022 19:58
@iwilltry42 iwilltry42 force-pushed the registry-pull-through branch from 1160b23 to c824c65 Compare June 6, 2022 20:01
@iwilltry42 iwilltry42 linked an issue Jun 6, 2022 that may be closed by this pull request
Copy link
Member

@iwilltry42 iwilltry42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Tested and it works perfectly well 👍

@iwilltry42 iwilltry42 force-pushed the registry-pull-through branch from 441c452 to 7621cca Compare June 7, 2022 08:06
@iwilltry42 iwilltry42 merged commit 60ec077 into k3d-io:main Jun 7, 2022
@iwilltry42
Copy link
Member

Thank you very much @ethinx ! 👍

@ethinx
Copy link
Contributor Author

ethinx commented Jun 7, 2022

Thank you very much @ethinx ! 👍

my pleasure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] support for pull-through registry
2 participants