A few months ago I started a series of articles about Elixir, K8s and libcluser[0], but unfortunately I did not have time to continue it yet.
If you're using K8s, what I would suggest is:
- create multiple releases of your Mix project[1] with specific OTP applications in each
- one Docker container per release
- one K8s Deployment per release
- one headless K8s Service selecting the pods for all your deployments
- use libcluster for automated cluster formation
Then, with node affinity/tolerations, you can control on which physical node you'll run it (if you want).
If you're not using K8s, you can use an Ansible playbook to deploy each distinct release on the target host, and you can use libcluster with a static cluster configuration. This will work the same.
[0] - https://medium.com/@david-delassus/elixir-and-kubernetes-a-l...
[1] - https://elixir-lang.org/getting-started/mix-otp/config-and-r...