Add local kind registry for Tilt development setup#310
Open
felix-kaestner wants to merge 1 commit intomainfrom
Open
Add local kind registry for Tilt development setup#310felix-kaestner wants to merge 1 commit intomainfrom
felix-kaestner wants to merge 1 commit intomainfrom
Conversation
This change introduces hack/kind-with-registry.sh, adapted from https://kind.sigs.k8s.io/docs/user/local-registry and inspired by the now-archived https://github.com/tilt-dev/kind-local, and wires it into the make kind-create and make kind-delete targets. A local registry is preferred over alternatives such as 'kind load docker-image' because Docker layer caching applies when pushing to a registry: layers that already exist in the registry are skipped, so only the changed layers are transferred. With kind load every push uploads the full image regardless of what changed. In addition, all traffic stays on the local machine with no network round-trips to a remote registry. Tilt (v0.12.0+) auto-detects the registry through the KEP-1755 local-registry-hosting ConfigMap published in kube-public and handles the image-tagging dance automatically. The script starts a registry:3 container bound to localhost:5000, creates the kind cluster (requires kind v0.27.0+), configures each node's containerd to resolve localhost:5000 to the registry container via /etc/containerd/certs.d/localhost:<port>/hosts.toml, connects the registry container to the kind Docker network so that the nodes can reach it by name, and publishes the local-registry-hosting ConfigMap. make kind-delete tears down both the cluster and the registry container.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change introduces hack/kind-with-registry.sh, adapted from https://kind.sigs.k8s.io/docs/user/local-registry and inspired by the now-archived https://github.com/tilt-dev/kind-local, and wires it into the make kind-create and make kind-delete targets.
A local registry is preferred over alternatives such as 'kind load docker-image' because Docker layer caching applies when pushing to a registry: layers that already exist in the registry are skipped, so only the changed layers are transferred. With kind load every push uploads the full image regardless of what changed. In addition, all traffic stays on the local machine with no network round-trips to a remote registry. Tilt (v0.12.0+) auto-detects the registry through the KEP-1755 local-registry-hosting ConfigMap published in kube-public and handles the image-tagging dance automatically.
The script starts a registry:3 container bound to localhost:5000, creates the kind cluster (requires kind v0.27.0+), configures each node's containerd to resolve localhost:5000 to the registry container via /etc/containerd/certs.d/localhost:/hosts.toml, connects the registry container to the kind Docker network so that the nodes can reach it by name, and publishes the local-registry-hosting ConfigMap. make kind-delete tears down both the cluster and the registry container.