Akka Cluster Bootstrap


Lightbend Orchestration is no longer actively developed and will reach its End of Life on April 15, 2020.

We recommend Migrating to the Improved Kubernetes Deployment Experience.

Akka Cluster Bootstrap is an extension module to Akka that allows an Akka Cluster to (semi) automatically discover its neighbouring nodes, and join the existing cluster, or safely form a new cluster for discovered nodes.

When enabled from Lightbend Orchestration, this feature will use service discovery to identify other contact points. Once the requisite number of contact points have been identified, the one with the lowest address will form the cluster. The other nodes will then join that one. See the Akka Cluster Bootstrap documentation for details.

This feature is automatically enabled for Lagom applications that require it. It can be manually enabled with the following build configuration:

enableAkkaClusterBootstrap := true

When you generate resources for a deployment, you’ll need to specify a replica count greater than 2. A value of 3 or 5 is recommended. This is to reduce the risk of multiple islands of clusters being formed when first formed. For example, the following command specifies 5 replicas which are used as the contact points for forming the cluster:

rp generate-kubernetes-resources my-org/my-app:0.1.0 --pod-controller-replicas 5

By default, the feature will be configured to communicate and join other applications with the same name. If you have two disparate applications that should join the same cluster, use the akkaClusterBootstrapSystemName setting. For example, all applications that specify the following will join the same cluster, even if they have different names:

akkaClusterBootstrapSystemName := "my-actor-system"

You can optionally use the –join-existing-akka-cluster flag to make sure new nodes will only join an existing cluster, and not form a new one themselves. This can be useful if you expect the cluster to never be fully down. It’s also quite useful for launching one-off processes or jobs that are intended to join an already bootstrapped cluster.

rp generate-kubernetes-resources my-org/my-app:0.1.0 --join-existing-akka-cluster

When deploying applications that use Akka Cluster, you’ll typically want them to join the same cluster. This is especially true if you use Akka Persistence features. Because of this, it is recommended that you avoid Blue/Green deployments and instead use the Canary (default) or Rolling deployment types

Akka Cluster Bootstrap using DNS

To use DNS for Akka Cluster Bootstrap instead of Kubernetes API, pass --discovery-method option as follows:

rp generate-kubernetes-resources my-org/my-app:0.1.0 --discovery-method=akka-dns