Search code examples
azureakkaservice-discovery

Akka discovery on Azure (with VMs)


I have an Akka application that runs on 1+1, 1+2, 1+3... virtual machines and Akka Systems are discovering each others.

On AWS I can use https://doc.akka.io/docs/akka-management/current/discovery/aws.html#discovery-method-aws-api-ec2-tag-based-discovery, so I can change the number of plus nodes easily on demand.

For running the same setup on Azure I cannot see any good options in the list: https://doc.akka.io/docs/akka/current/discovery/index.html

Could you suggest a solution for Azure installation, that doesn't need additional managed service like Consul? Going to


Solution

  • I confirm that there isn't anything available for discovering raw Azure VMs like there is with AWS.

    My recommendation would be to use an Azure based Kubernetes solution like ARO or AKS. Kubernetes has also been the direction most Akka deployments are going. Discovery is just one of the many features why. (I've never seen Consul used for Akka, there is indeed a discovery module available, but I'd estimate that 99%+ of Akka on orchestration platforms in 2022 is Kubernetes.)

    But since your question is how to do this without an orchestration layer, you could either write and contribute your own discovery module or you could use seed nodes.

    • On the first option, discovery modules really aren't super complicated. All they do is return a list of IP/ports to attempt to connect to based on a what API you have (AWS,Azure,K8S, etc). The main disadvantage of this approach is that you will be running a very unique implementation.
    • The other option is to run seed nodes. For high availability I'd recommend running 2+n, rather than 1+n. As long as you have two stable nodes, this isn't a terrible option. Certainly not as dynamic or robust as a Kubernetes based solution, but not terrible.