Search⌘ K

The Example with Kubernetes

Explore how to implement microservices using Kubernetes for container orchestration, focusing on service discovery, load balancing, fail-safety, and routing mechanisms with Apache and node ports. Understand the interaction between microservices and how Kubernetes manages pods and replica sets to ensure reliability and scalability.

Introduction #

The services in this example are identical with the examples presented in the two preceding chapters (see Example).

  • The catalog microservice manages the information about the items. It provides an HTML UI and a REST interface.

  • The customer microservice stores the customer data and also provides an HTML UI and a REST interface.

  • The order microservice can receive new orders. It provides an HTML UI and uses the REST interfaces of the catalog and customer microservice.

  • An Apache web server facilitates access to the individual microservices. It forwards the calls to the respective services.

The drawing above shows how the microservices interact. The order microservice communicates with the catalog and the customer microservice while the Apache httpd server communicates with all other microservices to display the HTML UIs.

The microservices are accessible from the outside via node ports. On each node in the cluster, a request to a specific port will be forwarded to the service. However, the port numbers are assigned by Kubernetes, so there is no port number in the figure.

A load balancer is set up by the Kubernetes service to distribute the load across Kubernetes nodes.

Implementing microservices with Kubernetes

...