Deploy Akka Cluster on Kubernetes
Deploy and configure an Akka Cluster application to run on top of Kubernetes
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.
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!
- 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.
Find the detailed steps for this pattern in the README. The steps will show you how to:
- Clone the repo
- Build the Docker base image
- Build the sample app
- Deploy the cluster on Kubernetes
- Confirm the sample app is working