using kind to pull images from a local registry
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
KIND (Kubernetes IN Docker) runs Kubernetes clusters inside Docker containers for local development and testing. By default, KIND nodes cannot pull images from a local Docker registry because the cluster network is isolated. Configuring KIND to use a local registry lets you test custom images without pushing them to a remote registry like Docker Hub.
Prerequisites
- Docker: Ensure Docker is installed and running on your local machine
- kind: Install from the official GitHub repository
- kubectl: Install to interact with your kind cluster
Step 1: Create a Local Docker Registry
Step 2: Create a KIND Cluster Connected to the Registry
Create a kind-config.yaml:
Create the cluster:
Step 3: Connect the Registry to the KIND Network
Step 4: Configure the Registry as a Local ConfigMap
This tells Kubernetes about the local registry:
Step 5: Build, Tag, and Push Images
Step 6: Deploy Using the Local Registry Image
Complete Setup Script
The KIND project provides an official script that automates all the steps:
Alternative: kind load docker-image
For one-off testing, you can load images directly into KIND nodes without a registry:
This is simpler but does not scale well for multiple images or CI pipelines.
Common Pitfalls
- Network isolation: KIND nodes run in Docker containers with their own network. The registry must be on the same Docker network (
kind) for nodes to reach it. - Image pull policy: Set
imagePullPolicy: IfNotPresentorimagePullPolicy: Neverfor local images. The defaultAlwaystries to pull from a remote registry and fails. - Port mapping: The registry runs on port 5000 internally but is exposed on port 5001 to avoid conflicts. Use
localhost:5001when pushing and in pod specs. - Cluster recreation: If you delete and recreate the KIND cluster, reconnect the registry to the new
kindDocker network. - containerd vs Docker: KIND uses containerd, not Docker, inside nodes. The
containerdConfigPatchesin the cluster config tells containerd where to find the registry.
Summary
- Run a local Docker registry and connect it to the KIND Docker network
- Configure KIND's containerd to mirror
localhost:5001to the registry container - Tag and push images to
localhost:5001/image:tag - Reference the same image path in Kubernetes pod specs
- For quick tests, use
kind load docker-imageto bypass the registry entirely

