Image for post
Image for post
Photo by Pero Kalimero on Unsplash

Hello folks,

In this article, we will deploy a simple Spring Boot based application inside a K8S cluster.

To take the best of this article you should have a basic understanding of these subjects :

  • Docker because we will be using it as the runtime to containerize the app.
  • A K8S cluster (standalone or MiniKube) running in your local machine or use some of the cloud providers like https://www.linode.com/.
  • A basic understanding of Java and Spring boot

Prepare the simple app :

First things first let’s prepare the application. We will expose a greeting endpoint that we can later consume by calling the path /hello

Image for post
Image for post
/hello endpoint

To make it simple i implemented the endpoint directly in the entry point of the application which it’s not a good practice, you know SOC or SOR ( yes you’re right, one of the SOLID principales). …

Image for post
Image for post
Photo by Pero Kalimero on Unsplash

Hello Folks,

In the previous article, we discussed how to deploy our simple application into a K8S cluster. Feel free to have a quick look at it, because it would help in this article in which we will explain how to consume the deployed application from the previous article.

We left the last article with this challenge in mind:

How we can consume our hello endpoint from two running instances of the same application with different IP addresses ?

Obviously, the automatic answer was to place a load balancer and it’s the right answer. but it’s not the only way to access a deployed application in K8S. In fact, a Load balancer is just one of the four types of services that are available for use in K8S, these four types are…

About

Mourad KHAIRANE

Software Engineer and part-time Scrum master at @ING

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store