Health Check API and Service Discovery in Microservice Environment
Minkkilä, Juuso (2019)
Minkkilä, Juuso
2019
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:amk-201905037393
https://urn.fi/URN:NBN:fi:amk-201905037393
Tiivistelmä
The thesis was assigned by Landis+Gyr Oy as a part of an initiative to improve the company’s microservices. The purpose of the study was to research service discovery system and service health check patterns as ways to ensure the connectivity of healthy microservice instances with a reduced need for configuration. Thus, the objectives set by the company were to research how both patterns could be applied to microservices, what problems they solve, and how the patterns affect microservices. After researching the subjects at hand, a plan was made to create a proof of concept demonstrating them. This proof of concept system would fulfil the most rudimentary requirements for both patterns. During the planning many viable tools such as Consul were found and further inspected. However, only some of those tools were later used during the implementation.
The end goal of the thesis was to create a proof of concept system implementing both service discovery and service specific health check APIs. Two microservices were created with Scala programming language and its Akka-libraries. The services were configured to use Consul as their primary tool for service discovery, allowing them to discover each other properly. Verizon’s Helm library was used in the Scala services to interface with Consul’s HTTP API. Everpeace’s Healthchecks library was used to add health checks for the services along with HTTP endpoints to display services’ health.
The primary goals of the thesis were achieved. However, many of the initial side goals such as containerizing the services were left out of the thesis as its scope was narrowed. While the way Consul was used in the thesis is suboptimal for production, the services could discover healthy instances of each other based on the service name alone. This successfully demonstrates the benefits of service discovery and health checks.
The end goal of the thesis was to create a proof of concept system implementing both service discovery and service specific health check APIs. Two microservices were created with Scala programming language and its Akka-libraries. The services were configured to use Consul as their primary tool for service discovery, allowing them to discover each other properly. Verizon’s Helm library was used in the Scala services to interface with Consul’s HTTP API. Everpeace’s Healthchecks library was used to add health checks for the services along with HTTP endpoints to display services’ health.
The primary goals of the thesis were achieved. However, many of the initial side goals such as containerizing the services were left out of the thesis as its scope was narrowed. While the way Consul was used in the thesis is suboptimal for production, the services could discover healthy instances of each other based on the service name alone. This successfully demonstrates the benefits of service discovery and health checks.