Summary
Akka Cluster is a fault-tolerant peer-to-peer cluster membership service. Kubernetes provides mulitple features that are a great fit for running applications built with Akka Cluster. This code pattern shows you how to configure your Akka Cluster application to run on top of Kubernetes, taking advantage of its many standard features.
Description
Akka is a toolkit for building distributed, message-driven applications for Java and Scala. Developers look to Akka to manage concurrency, elasticity, and resilience. They start with this actor-based system before adopting frameworks such as Play and Lagom.
Kubernetes automates deployment and management of containerized applications. Because an Akka Cluster manages applications but not containers, you’ll need to use container orchestration — and Kubernetes is a logical choice. However, due to different design perspectives, deploying Akka Clusters on Kubernetes is not completely straightforward. Akka Cluster is elastic and decentralized. A Kubernetes cluster is also elastic. So how do you seamlessly combine the two to get the benefits of each?
In this code pattern, we will walk through the steps to deploy Akka Cluster on Kubernetes. We’ll show you the challenges involved, and how to overcome them. You’ll complete deployment steps and discover how Kubernetes can seamlessly manage Akka Cluster scaling using built-in Akka functionality, and you’ll learn how to use StatefulSet to bridge the different node and pod requirements in Akka and Kubernetes, respectively.
If you’re a developer looking to tap into Akka’s libraries to design scalable, resilient systems and you want to take advantage of container orchestration to manage your services and workloads, this pattern is your starting point!
Flow
- Add tools to the the Docker base image.
- Use the sbt build tool to build the sample app in the Docker image.
- Push the Docker image to a Docker repository.
- Deploy Akka Cluster on Kubernetes with a StatefulSet.
- Try Akka Cluster scaling.
Instructions
Find the detailed steps for this pattern in the README. The steps will show you how to:
- Clone the repo
- Prerequisites
- Build the Docker base image
- Build the sample app
- Deploy the cluster on Kubernetes
- Confirm the sample app is working
Share our content
-
- Lightbend JVM application development platforms for building microservices and fast data applications.
- Akka documentation Everything you need to know about this set of open-source libraries for designing scalable, resilient systems that span processor cores and networks.
- Kubernetes Open source system for automating deployment, scaling, and management of containerized applications.
- Kubernetes StatefulSets Understand Kubernetes' workload API object used to manage stateful applications.