Difficulty: Beginner
Estimated Time: 15 minutes

Ready to climb a mountain? In this scenario, you will deploy a small microservice-based application that runs on Kubernetes. The two primary topics we will cover are:

  • Discovering some efficient ways of bundling a Kotlin application into a distilled container
  • Discovering how a Node.js application can communicate through gRPC to a Kotlin microservice

The application consists of two applications. The server application is the model running as a microservice, written in Kotlin. The client application is a small Express web interface. Both applications communicate via gRPC. The UI will present the standard create, read, update, and delete actions (CRUD).

Why Kotlin? It's an efficient language that makes developers happier.

We think of Kotlin as a modern language for industry: it is focused on flexible abstractions for code reuse and readability, static type safety for early error detection and explicit capturing of intent for maintainability and clarity. One of the most important use cases for Kotlin is a big Java codebase whose developers want a better language: you can mix Java and Kotlin freely and migration can be gradual and doesn't have to alter an entire codebase. -- Andrey Breslav, creator

For efficiency, the example code has been pre-written, but it's very small and should be easy to dissect and understand.

You will learn how to:

  • Write a simple Kotlin and Spring Boot-based microservice
  • Write a getting started Node.js web application
  • Communicate between two applications using gRPC
  • Compose a Kotlin application into a distilled container
  • Push a container to a private registry on Kubernetes
  • Instruct Kubernetes to start applications
  • Access an application service running on Kubernetes

All of this you will build into containers and run on Kubernetes.

You just climbed a big mountain. You tackled the concepts of building a Kotlin microservice into a container and connecting it to a web application with gRPC. All of this running on Kubernetes. Enjoy the fresh air at the top.

You can use this scenario as a building block for your next gRPC-based microservice. It may not be in Kotlin, but the same concepts and gRPC API library calls can be applied in a variety of other languages.

Lessons Learned

With these steps you have learned how to:

  • Write a simple Kotlin and Spring Boot-based microservice
  • Write a getting started Node.js web application
  • Communicate between two applications using gRPC
  • Compose a Kotlin application into a distilled container
  • Push a container to a private registry on Kubernetes
  • Instruct Kubernetes to start applications
  • Access an application service running on Kubernetes

References


For a deeper understanding of these topics and more, join
Jonathan Johnson
at various conferences, symposiums, workshops, and meetups.

Software Architectures ★ Speaker ★ Workshop Hosting ★ Kubernetes & Java Specialist

Kubernetes Containers: Kotlin to Kubernetes

Step 1 of 7

Your Kubernetes Cluster

For this scenario, Katacoda has just started a fresh Kubernetes cluster for you. Verify that it's ready for your use.

kubectl version --short && \ kubectl get componentstatus && \ kubectl get nodes && \ kubectl cluster-info

The Helm package manager used for installing applications on Kubernetes is also available.

helm version --short

Kubernetes Dashboard

You can administer your cluster with the kubectl CLI tool or use the visual Kubernetes Dashboard. Use this script to access the protected Dashboard.

token.sh

Terminal
Kubernetes Dashboard
Mountains App