Akka cluster stretched over multiple kubernetes clusters


Is it possible to have a stretched Akka cluster on top of multiple Kubernetes clusters? I’m now using Akka Management to set-up my Akka cluster in a single Kubernetes cluster.
But I’d like to have this in multiple clusters, how I can let the Akka nodes discover each other in a different Kubernetes cluster?

Any pointers would be appreciated!

1 Like

Short answer:

No you can’t do this. And you probably shouldn’t do it even if you could: just from a logical and management perspective.

If you are looking to stretch across K8S clusters for DR reasons, look into something like Replicated Event Sourcing. If you are looking for some other reason, there’s almost certainly a better architecture than trying to stretch an Akka Cluster across K8S clusters.

Longer answer:

Fundamentally the nodes in an Akka cluster need to directly communicate with each other and be on a single reliable/fast network. Because of that need to directly communicate with each other, the only way to build a “stretch” Akka cluster would be to connect the K8S clusters with something like Submariner.

But if you are on a single reliable/fast network, I can’t really think of any reason deploying Submariner would be worth it instead of just combining the two K8S clusters into a single cluster.

I’m spending more time thinking about this question than I should because it’s intellectually interesting, but it boils down to the that fact that the only cases I can think of where it would be physically possible to do so, there would be no logical benefit.

The Kubernetes clusters can be within a flat network allowing “naturally” pods from different clusters to communicate to each other, so you don’t need to install any additional “thingies”. @davidogren does it help to put the question in perspective? (disclaimer, I am working with @DieBauer on this "unusual (really?) setup ;-)