Slide 1

Slide 1 text

Akka cluster management on Kubernetes “One Actor is no Actor - they come in systems” — Carl Hewitt

Slide 2

Slide 2 text

About me Jeferson David Ossa @unyagami on twitter Developer at s4n.co

Slide 3

Slide 3 text

The aim of this workshop is to get familiar with Akka Management Service Discovery using Kubernetes API. We will create a stateful distributed service with persistent entities via sharding in persistence mode. A account's general balance which will receive credits and debits from potentially multiple simultaneous sources.

Slide 4

Slide 4 text

The tools ● Sbt ○ https://www.scala-sbt.org/download.html ● Docker ○ https://docs.docker.com/install/ ● Minikube ○ https://kubernetes.io/docs/tasks/tools/install-minikube/ ● Cassandra ○ http://cassandra.apache.org/download/

Slide 5

Slide 5 text

The repo https://github.com/jedossa/akka-cluster-k8s.git minikube start --memory=4096 sbt groll initial

Slide 6

Slide 6 text

The image eval $(minikube docker-env) sbt docker:publishLocal ./create

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Akka Cluster ● Node ● Seed Node ● Cluster ● Leader ● Gossip ● Convergence ● Failure Detector

Slide 9

Slide 9 text

Membership Life Cycle

Slide 10

Slide 10 text

Akka Management

Slide 11

Slide 11 text

Bootstrap Process

Slide 12

Slide 12 text

Service Discovery Akka Discovery provides a simple interface around various ways of locating services, such as DNS. Kubernetes API ● Find pods labeled with the name of the Akka Management port

Slide 13

Slide 13 text

Cluster Sharding How to distribute entities across the entire cluster with location transparency. Send messages without requiring the sender to know the location of the destination actor. Send messages to ShardRegion Actor, wich knows how to route it. How does it work ? sbt: groll next, docker:publishLocal ./delete, ./create

Slide 14

Slide 14 text

Akka Persistence Enables stateful actors to persist their internal state so that it can be recovered when an actor is started, restarted after a JVM crash or by a supervisor, or migrated in a cluster. Only changes to an actor’s internal state are persisted but never its current state directly (except for optional snapshots) sbt: groll next, docker:publishLocal ./delete, ./create

Slide 15

Slide 15 text

References ● https://developer.lightbend.com/docs/akka-management/current/akka-manag ement.html ● https://doc.akka.io/docs/akka/2.5/cluster-usage.html ● https://doc.akka.io/docs/akka/2.5/cluster-sharding.html ● https://doc.akka.io/docs/akka/2.5/persistence.html ● https://github.com/akka/akka-management/tree/master/bootstrap-demo/kuber netes-api