rpardini / docker-registry-proxy

An HTTPS Proxy for Docker providing centralized configuration and caching of any registry (quay.io, DockerHub, k8s.gcr.io)
Apache License 2.0
912 stars 170 forks source link

Works with kind? #92

Closed curtbushko closed 3 years ago

curtbushko commented 3 years ago

Has anyone gotten this proxy to work with kubernetes kind for local development?

https://kind.sigs.k8s.io/docs/user/quick-start/

sestegra commented 3 years ago

@curtbushko It works well on kind as well.

Let's say you setup the proxy on host 192.168.66.72 Launch following script after creating your cluster.

#!/bin/sh

KIND_NAME=${1-kind}
SETUP_URL=http://192.168.66.72:3128/setup/systemd
for NODE in $(kind get nodes --name "$KIND_NAME"); do
  echo "Configure docker-registry-proxy on $NODE"
  curl -s $SETUP_URL \
    | sed s/docker\.service/containerd\.service/g \
    | 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"/' \
    | docker exec -i "$NODE" bash -
done
leorolland commented 3 years ago

@sestegra You are my hero, after trying for several hours, my kind cluster is finally working ! Thx !

rpardini commented 3 years ago

👍 I'll take PR for adding this as documentation if you'll send it.