Kind Kubernetes Development
Kubernetes in Docker with Kind, local registry, and kubectl configured.
Overview
Kind (Kubernetes IN Docker) is a tool originally developed by the Kubernetes community for testing Kubernetes itself, transforming how developers interact with Kubernetes locally. By running Kubernetes nodes as Docker containers, Kind eliminates the complexity of setting up virtual machines or bare metal clusters while maintaining full Kubernetes API compatibility. This approach has revolutionized local development workflows since its introduction in 2019, making Kubernetes accessible to developers without requiring expensive infrastructure.
This stack combines Kind's containerized Kubernetes cluster with a local Docker registry and NGINX ingress controller, creating a complete development ecosystem that mirrors production environments. The local registry eliminates the need to push images to external registries during development, while NGINX provides HTTP/HTTPS ingress capabilities with its proven performance characteristics. The registry UI component adds visual management of container images, streamlining the development workflow from build to deployment.
Kubernetes application developers, DevOps engineers building CI/CD pipelines, and teams transitioning from traditional deployment models to cloud-native architectures will find this stack invaluable. Unlike managed Kubernetes services that incur costs and require internet connectivity, this configuration runs entirely on local infrastructure while providing the same APIs and behaviors as production clusters, making it perfect for rapid prototyping, integration testing, and learning Kubernetes concepts.
Key Features
- Full Kubernetes v1.29 cluster running as Docker containers with complete API compatibility
- Local Docker registry v2 with push/pull capabilities for rapid image iteration
- Web-based registry UI with search and browsing capabilities for image management
- NGINX Alpine-based ingress controller with HTTP/HTTPS traffic routing
- NodePort service access through mapped ports 30000-30100 for external connectivity
- Privileged container execution enabling advanced Kubernetes features like CNI plugins
- Shared kernel modules access for container runtime compatibility
- Bridge network isolation for secure inter-component communication
Common Use Cases
- 1Kubernetes application development and testing without cloud provider costs
- 2CI/CD pipeline development requiring full Kubernetes API testing capabilities
- 3Microservices architecture prototyping with ingress traffic management
- 4Container image build and deployment workflow optimization
- 5Kubernetes operator development requiring real cluster interactions
- 6Educational environments for learning Kubernetes concepts hands-on
- 7Integration testing of Helm charts and Kubernetes manifests before production deployment
Prerequisites
- Docker Engine with privileged container support and at least 4GB RAM available
- Kind CLI tool installed for cluster lifecycle management operations
- kubectl configured for Kubernetes cluster interaction and manifest deployment
- Available ports 80, 443, 5001, 6443, 8080, and 30000-30100 on host system
- Basic understanding of Kubernetes concepts including pods, services, and ingress
- Familiarity with Docker registry operations for image push/pull workflows
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 kind-control-plane: 3 image: kindest/node:v1.29.04 privileged: true5 volumes: 6 - /lib/modules:/lib/modules:ro7 - kind_data:/var8 environment: 9 KIND_EXPERIMENTAL_PROVIDER: docker10 ports: 11 - "6443:6443"12 - "30000-30100:30000-30100"13 networks: 14 - kind-net15 restart: unless-stopped1617 registry: 18 image: registry:219 ports: 20 - "5001:5000"21 volumes: 22 - registry_data:/var/lib/registry23 networks: 24 - kind-net25 restart: unless-stopped2627 registry-ui: 28 image: joxit/docker-registry-ui:latest29 ports: 30 - "8080:80"31 environment: 32 REGISTRY_TITLE: Kind Registry33 REGISTRY_URL: http://registry:500034 depends_on: 35 - registry36 networks: 37 - kind-net38 restart: unless-stopped3940 nginx-ingress: 41 image: nginx:alpine42 ports: 43 - "80:80"44 - "443:443"45 volumes: 46 - ./nginx.conf:/etc/nginx/nginx.conf:ro47 networks: 48 - kind-net49 restart: unless-stopped5051volumes: 52 kind_data: 53 registry_data: 5455networks: 56 kind-net: 57 driver: bridge.env Template
.env
1# Kind Cluster Name2KIND_CLUSTER_NAME=local-dev34# Registry Port5REGISTRY_PORT=5001Usage Notes
- 1Use kind CLI for cluster management
- 2Local registry at localhost:5001
- 3NodePorts available 30000-30100
- 4Configure kubectl with kind export kubeconfig
Individual Services(4 services)
Copy individual services to mix and match with your existing compose files.
kind-control-plane
kind-control-plane:
image: kindest/node:v1.29.0
privileged: true
volumes:
- /lib/modules:/lib/modules:ro
- kind_data:/var
environment:
KIND_EXPERIMENTAL_PROVIDER: docker
ports:
- "6443:6443"
- 30000-30100:30000-30100
networks:
- kind-net
restart: unless-stopped
registry
registry:
image: registry:2
ports:
- "5001:5000"
volumes:
- registry_data:/var/lib/registry
networks:
- kind-net
restart: unless-stopped
registry-ui
registry-ui:
image: joxit/docker-registry-ui:latest
ports:
- "8080:80"
environment:
REGISTRY_TITLE: Kind Registry
REGISTRY_URL: http://registry:5000
depends_on:
- registry
networks:
- kind-net
restart: unless-stopped
nginx-ingress
nginx-ingress:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
networks:
- kind-net
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 kind-control-plane:5 image: kindest/node:v1.29.06 privileged: true7 volumes:8 - /lib/modules:/lib/modules:ro9 - kind_data:/var10 environment:11 KIND_EXPERIMENTAL_PROVIDER: docker12 ports:13 - "6443:6443"14 - "30000-30100:30000-30100"15 networks:16 - kind-net17 restart: unless-stopped1819 registry:20 image: registry:221 ports:22 - "5001:5000"23 volumes:24 - registry_data:/var/lib/registry25 networks:26 - kind-net27 restart: unless-stopped2829 registry-ui:30 image: joxit/docker-registry-ui:latest31 ports:32 - "8080:80"33 environment:34 REGISTRY_TITLE: Kind Registry35 REGISTRY_URL: http://registry:500036 depends_on:37 - registry38 networks:39 - kind-net40 restart: unless-stopped4142 nginx-ingress:43 image: nginx:alpine44 ports:45 - "80:80"46 - "443:443"47 volumes:48 - ./nginx.conf:/etc/nginx/nginx.conf:ro49 networks:50 - kind-net51 restart: unless-stopped5253volumes:54 kind_data:55 registry_data:5657networks:58 kind-net:59 driver: bridge60EOF6162# 2. Create the .env file63cat > .env << 'EOF'64# Kind Cluster Name65KIND_CLUSTER_NAME=local-dev6667# Registry Port68REGISTRY_PORT=500169EOF7071# 3. Start the services72docker compose up -d7374# 4. View logs75docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/minikube-alternative-stack/run | bashTroubleshooting
- Kind cluster fails to start with 'permission denied' errors: Ensure Docker daemon is running and user has Docker group membership or sudo access
- kubectl connection refused on port 6443: Run 'kind export kubeconfig' to update kubectl configuration with correct cluster endpoint
- Container images not found when deploying to cluster: Tag images with 'localhost:5001/' prefix and push to local registry before applying manifests
- NGINX ingress returns 503 Service Temporarily Unavailable: Verify ingress controller pods are running and backend services have ready endpoints
- Registry UI shows empty repository list: Check registry container logs for permission issues and verify registry_data volume mount permissions
- NodePort services unreachable from host: Confirm port mapping in docker-compose matches service nodePort definition and firewall allows connections
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download