Skip to content

Latest commit

 

History

History

local-registry

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Local Registry

A local registry to use for faster feedback on kubernete deployments using minikube

This registry will persist when you stop and start your cluster

To create the registry run:

$ kubectl create -f registry.yml

To check that the registry is working in the kubernetes cluster

$ minikube ssh
$ curl http://localhost:5000/v2/_catalog

To configure your local docker to use the docker daemon on the kubernate cluster do:

  • on mac / linux
$ eval $(minikube docker-env)
  • on windows
> @for /f "tokens=*" %i IN ('minikube docker-env') DO @%i

now you could build your docker and publishin in the registry inside the cluster

for example to publish a image named hello:

$ docker build . -t hello
$ docker tag hello localhost:5000/hello
$ docker push localhost:5000/hello

now to run the image in the kubernetes cluster

$ kubectl.exe run hello --image=localhost:5000/hello --port=8080

to expose as a service

$ kubectl.exe expose deployment hello --type=NodePort

and finally to show it on your browser

$ minikube service hello

This service will be enable back again after stoping / starting your cluster

You could check the contents of the registry doing

$ minikube ssh
$ curl http://localhost:5000/v2/_catalog
{"repositories":["hello"]}