Skip to content

Commit 2456b35

Browse files
authored
Merge pull request #99 from leorolland/master
doc: add kind cluster usage
2 parents c949381 + 4bb60c8 commit 2456b35

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Diff for: README.md

+35
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,41 @@ docker run --rm --name docker_registry_proxy -it \
176176
rpardini/docker-registry-proxy:0.6.2
177177
```
178178

179+
### Kind Cluster
180+
181+
[Kind](https://github.com/kubernetes-sigs/kind/) is a tool for running local Kubernetes clusters using Docker container “nodes”.
182+
183+
Because cluster nodes are Docker containers, docker-registry-proxy needs to be in the same docker network.
184+
185+
Example joining the _kind_ docker network and using hostname _docker-registry-proxy_ as hostname :
186+
187+
```bash
188+
docker run --rm --name docker_registry_proxy -it \
189+
--net kind --hostname docker-registry-proxy \
190+
-p 0.0.0.0:3128:3128 -e ENABLE_MANIFEST_CACHE=true \
191+
-v $(pwd)/docker_mirror_cache:/docker_mirror_cache \
192+
-v $(pwd)/docker_mirror_certs:/ca \
193+
rpardini/docker-registry-proxy:0.6.2
194+
```
195+
196+
Now deploy your Kind cluster and then automatically configure the nodes with the following script :
197+
198+
```bash
199+
#!/bin/sh
200+
KIND_NAME=${1-kind}
201+
SETUP_URL=http://docker-registry-proxy:3128/setup/systemd
202+
pids=""
203+
for NODE in $(kind get nodes --name "$KIND_NAME"); do
204+
docker exec "$NODE" sh -c "\
205+
curl $SETUP_URL \
206+
| sed s/docker\.service/containerd\.service/g \
207+
| sed '/Environment/ s/$/ \"NO_PROXY=127.0.0.0\/8,10.0.0.0\/8,172.16.0.0\/12,192.168.0.0\/16\"/' \
208+
| bash" & pids="$pids $!" # Configure every node in background
209+
done
210+
wait $pids # Wait for all configurations to end
211+
```
212+
213+
179214
## Configuring the Docker clients using Docker Desktop for Mac
180215

181216
Separate instructions for Mac clients available in [this dedicated Doc Desktop for Mac document](Docker-for-Mac.md).

0 commit comments

Comments
 (0)