Skip to content
Browse files

simplify registry proof of concept

  • Loading branch information
BenTheElder committed Feb 5, 2020
1 parent 779fcc8 commit 4b3beebe8d2097b5c2be27de742e0ef15c78ec74
Showing with 5 additions and 13 deletions.
  1. +2 −4 site/content/docs/user/
  2. +3 −9 site/static/examples/
@@ -26,9 +26,7 @@ The registry can be used like this.
1. First we'll pull an image `docker pull`
2. Then we'll tag the image to use the local registry `docker tag localhost:5000/hello-app:1.0`
3. Then we'll push it to the registry `docker push localhost:5000/hello-app:1.0`
4. And now we can use the image `kubectl create deployment hello-server --image=registry:5000/hello-app:1.0`
4. And now we can use the image `kubectl create deployment hello-server --image=localhost:5000/hello-app:1.0`

If you build your own image and tag it like `localhost:5000/image:foo` and then use
it in kubernetes as `registry:5000/image:foo`.

> Note: you may update your local hosts file as well, for example by adding ` registry` in your laptop's `/etc/hosts`, so you can reference it in a consistent way by simply using `registry:5000`.
it in kubernetes as `localhost:5000/image:foo`.
@@ -13,20 +13,14 @@ if [ "${running}" != 'true' ]; then
-d --restart=always -p "${reg_port}:5000" --name "${reg_name}" \
reg_ip="$(docker inspect -f '{{.NetworkSettings.IPAddress}}' "${reg_name}")"

# create a cluster with the local registry enabled in containerd
cat <<EOF | kind create cluster --name "${KIND_CLUSTER_NAME}" --config=-
kind: Cluster
- |-
endpoint = ["http://registry:${reg_port}"]
endpoint = ["http://${reg_ip}:${reg_port}"]

# add the registry to /etc/hosts on each node
cmd="echo $(docker inspect -f "${ip_fmt}" "${reg_name}") registry >> /etc/hosts"
for node in $(kind get nodes --name "${KIND_CLUSTER_NAME}"); do
docker exec "${node}" sh -c "${cmd}"

0 comments on commit 4b3beeb

Please sign in to comment.
You can’t perform that action at this time.