Deploy Spring Boot microservices on Kubernetes  

Build and deploy Java Spring Boot microservices on a Kubernetes cluster

Last updated | By Anthony Amanse, John Zaccone, Animesh Singh

Description

Spring Boot is an opinionated framework for quickly building production-ready Spring applications. This journey shows you how to create and deploy Spring Boot microservices within a polyglot application and then deploy the app to a Kubernetes cluster.

Overview

The Java community is finding innovative ways to use technologies like Java EE within microservices architectures. The Spring framework is an established presence in the Java ecosystem, and now Spring Boot is garnering a lot of attention because it radically simplifies writing a Spring application.

Spring Boot takes an opinionated view of building Spring applications. You can use Spring Boot to create stand-alone Java applications that can be started using the Java -jar command or more traditional WAR deployments. Spring applications can be deployed as WAR files atop existing app servers, or they can be built into a “fat” JAR file with an embedded app server. Either choice works well within a Docker container. You can then rely on native Spring platforms like Spring Cloud to perform tasks such as service discovery, registration, and load balancing.

But what do we do in the context of polyglot applications? For managing a system of polyglot microservices, you need a general-purpose microservices and container orchestration platform, and that’s where Kubernetes shines. In this developer journey, you’ll build an app called “Office Space” — and yes, it’s inspired by Michael Bolton’s idea in the movie Office Space. When you complete the journey, you’ll understand how to deploy a polyglot microservices application, including Spring Boot microservices, on a Kubernetes cluster.

Flow

  1. The Transaction Generator service written in Python simulates transactions and pushes them to the Compute Interest microservice.
  2. The Compute Interest microservice computes the interest and then moves the fraction of pennies to the MySQL database to be stored. The database can be running within a container in the same deployment or on a public cloud such as Bluemix.
  3. The Compute Interest microservice then calls the notification service to notify the user if an amount has been deposited in the user’s account.
  4. The Notification service uses OpenWhisk actions to send an email message to the user. You can also invoke an OpenWhisk action to send messages to Slack.
  5. Additionally, an OpenWhisk action to send messages to Slack can also be invoked.
  6. The user retrieves the account balance by visiting the Node.js web interface.

Related Blogs

IBM Day – Blockchain over Kubernetes and Kubernetes Upstream – Recap of RTP Kubernetes Meetup

Co-Author:
 Tong Li, @email4tong The Research Triangle Park (RTP), NC Kubernetes Meetup is a well-organized event and its members regularly meet every month. It has over 750 registered members. The meetup speakers are SMEs from various companies like Red Hat, IBM, Lenovo, Google and many local startups like CloudPerceptions. The last Kubernetes meetup for 2017...

Continue reading IBM Day – Blockchain over Kubernetes and Kubernetes Upstream – Recap of RTP Kubernetes Meetup

Newsletters: The Curious Developer’s Best Friend

The great thing about software development is that there is always something new to learn! The terrible thing about software development is that there is always something new to learn! Luckily, there are tons of wonderful people sharing their knowledge every week in helpful and entertaining newsletters … and unfortunately, it can be really easy...

Continue reading Newsletters: The Curious Developer’s Best Friend

Kubernetes Upstream Contribution – 5 Do’s and Don’t

There is a good amount of documentation material out there on the Kubernetes community website which every contributor should read. However, if you are a new or intermediate contributor, or thinking to start contributing to Kubernetes upstream, hopefully, this post will help you understand some of the lessons that I have learned. This post discusses...

Continue reading Kubernetes Upstream Contribution – 5 Do’s and Don’t

Related Links