Kubernetes Deep Dive Room

Sign Up Free or Log In to participate!

Repository location – deployment

When putting in the repository location – how does Kubernetes know to go to DockerHub? How can you specify another location – Git for example?

1 Answers

You have to specify a registry which complies with the Docker Registry API (https://docs.docker.com/registry/spec/api/). This rules out Git because git is a distributed version control system and does not implement the Docker Registry API.

However, there are alternatives to using DockerHub, You could use a hosted docker registry (Quay, ECR, Google Docker Registry) or a private one (Nexus, JFrog, Docker Inc Registry,etc.)

You now have to tell your kubernetes container runtime (docker by default) to pull from the alternative docker registries. This generally involves two pieces of information:

1. The URL to the docker registry you want to use

2. The credentials (name,password,email) to pull from the new docker registry (assuming you don’t want to make your images public)

Here, is the documentation on how to do that: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/



What RM says is correct. I’ll just add (for clarification as RM has already mentioned it)…… at the time of recording, Kubernetes used Docker or containerd as its default runtime – that’s the bit that pull images and starts and stops containers etc. Docker is very opinionated and assumes Docker Hub unless you specify otherwise as stated by RM.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?