Skip to content

Commit

Permalink
Merge pull request #5612 from fiorix/master
Browse files Browse the repository at this point in the history
Add docs for using registry on macOS
  • Loading branch information
tstromberg authored Oct 17, 2019
2 parents 60ae033 + 8bf56f0 commit c376163
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions site/content/en/docs/Tasks/Registry/insecure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,30 @@ You can use the `--insecure-registry` flag on the
One nifty hack is to allow the kubelet running in minikube to talk to registries deployed inside a pod in the cluster without backing them
with TLS certificates. Because the default service cluster IP is known to be available at 10.0.0.1, users can pull images from registries
deployed inside the cluster by creating the cluster with `minikube start --insecure-registry "10.0.0.0/24"`.

### docker on macOS

Quick guide for configuring minikube and docker on macOS, enabling docker to push images to minikube's registry.

The first step is to enable the registry addon:

```
minikube addons enable registry
```

When enabled, the registry addon exposes its port 5000 on the minikube's virtual machine.

In order to make docker accept pushing images to this registry, we have to redirect port 5000 on the docker virtual machine over to port 5000 on the minikube machine. We can (ab)use docker's network configuration to instantiate a container on the docker's host, and run socat there:

```
docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
```

Once socat is running it's possible to push images to the minikube registry:

```
docker tag my/image localhost:5000/myimage
docker push localhost:5000/myimage
```

After the image is pushed, refer to it by `localhost:5000/{name}` in kubectl specs.

0 comments on commit c376163

Please sign in to comment.