Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others


0 votes
in Technique[技术] by (71.8m points)

macos - Access local process from local cluster

I have a local Kubernetes Cluster running under Docker Desktop on Mac. I am running another docker-related process locally on my machine (a local insecure registry). I am interested in getting a process inside the local cluster to push/pull images from the local docker registry.

How can I expose the local registry to be reachable from a pod inside the local Kubernetes cluster?

A way to do this would be to have both the Docker Desktop Cluster and the docker registry use the same docker network. Adding the registry to an existing network is easy. How does one add the Docker Desktop Cluster to the network?

Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As I mentioned in comments

I think what you're looking for is mentioned in the documentation here. You would have to add your local insecure registry as insecure-registries value in docker for desktop. Then after restart you should be able to use it.

Deploy a plain HTTP registry

This procedure configures Docker to entirely disregard security for your registry. This is very insecure and is not recommended. It exposes your registry to trivial man-in-the-middle (MITM) attacks. Only use this solution for isolated testing or in a tightly controlled, air-gapped environment.

Edit the daemon.json file, whose default location is /etc/docker/daemon.json on Linux or C:ProgramDatadockerconfigdaemon.json on Windows Server. If you use Docker Desktop for Mac or Docker Desktop for Windows, click the Docker icon, choose Preferences (Mac) or Settings (Windows), and choose Docker Engine.

If the daemon.json file does not exist, create it. Assuming there are no other settings in the file, it should have the following contents:

  "insecure-registries" : ["myregistrydomain.com:5000"]

Also found a tutorial for that on medium with macOS. Take a look here.

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share