Search code examples
kubernetesakkaakka-streamargo-workflowsargoproj

how to run an akka streaming app in argo and kubernetes?


How can you run an akka streams application in argo and kubernetes, I found documentation about kubernetes and akka cluster, but I don't need an akka cluster, do I just need to run an ephemeral akka application with many actors; or is an akka cluster necessary?


Solution

  • You can run an Akka Stream app on Kubernetes in a Deployment just like you can run it locally when testing.

    If you need your application to scale to many Pods and handle a lot of input, it may be helpful to use an Akka Cluster to better distribute the work.

    Argo Workflows and Akka Streams serve similar purposes: both connect a series of steps to transform data. Argo Workflows connects containers, and Akka Streams connects actors.

    Depending on your use case, it might make sense to have an Argo Workflows step that runs an Akka Streams app (which runs a while and then exits). But it might be simpler to write the whole series of steps as either just an Akka Streams app (which is then run on a Deployment) or just an Argo Workflow (made up of non-Akka Streams containers).

    tl;dr - There are a variety of "right" ways to run an Akka Streams app in Argo and/or Kubernetes. The "best" choice depends on your use case. At the end of the day, you either drop your Akka Streams container in the image field of either a Kubernetes Deployment or an Argo Workflow.