- Local Registry
- 1. Create registry container unless it already exists
- 2. Create kind cluster with containerd registry config dir enabled
- TODO: kind will eventually enable this by default and this patch will
- be unnecessary.
- See:
- https://github.com/kubernetes-sigs/kind/issues/2875
- https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration
- See: https://github.com/containerd/containerd/blob/main/docs/hosts.md
- 3. Add the registry config to the nodes
- This is necessary because localhost resolves to loopback addresses that are
- network-namespace local.
- In other words: localhost in the container is not localhost on the host.
- We want a consistent name that works from both ends, so we tell containerd to
- alias localhost:${reg_port} to the registry container when pulling images
- 4. Connect the registry to the cluster network if not already connected
- This allows kind to bootstrap the network but ensures they’re on the same network
- 5. Document the local registry
- https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry
Local Registry
This guide covers how to configure KIND with a local container image registry.
In the future this will be replaced by a built-in feature, and this guide will cover usage instead.
Create A Cluster And Registry
The following shell script will create a local docker registry and a kind cluster with it enabled.
examples/kind-with-registry.sh |
---|
Using The RegistryThe registry can be used like this.
If you build your own image and tag it like |