Registry Service:-

Anil Sharma
2 min readSep 8, 2020


In this example i will describe about the Registry service and then how can we set it up. Registry service is a service where all the other microservices register themselves and then we can identify how many instances are up. It also helps in the service discovery . When we use client side load balancers they fetch the instances of service by service name and then select one of the instances to call.

In this example we will be using Eureka discovery for it’s internal implementation.



Sample Code for registry application:-

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

public class RegistryApplication {

public static void main(String[] args) {, args);


(The complete code is shared in my Github repo at ).

Local Deployment:-

Once code is pulled, you can directly run it by using following command

mvn spring-boot:run

Once it is started you can access the Registry url using http://localhost:8761 . Since currently we haven’t developed/started the other micro-services hence currently the instances registered are empty.

Kubernetes Deployment:-

you can install minikube and virtualbox for local cloud installation

brew cask install virtualbox
brew install minikube

Now you can start the virtual node using following command

minikube start — driver=virtualbox --memory=2500

The run the following command to deploy the registry service(This file is present in the kuberenetes package of code.


This script will download the registry image from the docker registry and will deploy it in kubernetes node. After the deployment run the following command so that a tunnel is created between host system and kubernetes one node cluster that minikube creates.

 minikube tunnel 

Now open another terminal/command prompt tab and then run the following command. It will give you Ipaddress of the service in external endpoint.

kubectl get all -n anz-name-space

Now you can try hitting the url


you will see the Spring Eureka screen as shown without the localhost deployment.

If you are a designer/devops/dev and want to learn about easiest way of building, creating and then pushing images to docker registry then a must read.

Please feel free to ask any queries that you have on or in comments.