/explore-akka

This project is a demo of an Akka-http and Akka-cluster running on top of Kubernetes (minikube) and with its own Docker image created by sbt-native-packager. It also includes several other examples of the Akka Classic and Typed (essential, persistence, remote, cluster, stream, HTTP, serialization (Srapy-JSON, Avro, Kryo, protobuffer)).

Primary LanguageScalaApache License 2.0Apache-2.0

Build Status Coverage Status CodeFactor Codacy Badge GitHub issues GitHub closed issues Docker Image Size (latest by date) Lines of code

Exploring Akka 2.6.12 with Scala 2.12.7 and Java 8. The docker images are available at docker hub.

In action

Compile the project and verify the image created:

sbt docker:stage
sbt docker:publishLocal
docker images

Run the docker image: docker run -i felipeogutierrez/explore-akka:1.1 (don't forget the -i parameter to allow STDIN open!).

Running in k8s

minikube start --cpus 4 --memory 8192
kubectl create namespace akka

// This application is an Akka-http hello world
kubectl apply -f k8s/basics/hello-pod.yaml -n akka
kubectl port-forward hello 8001

This application is an Akka-cluster. 1 - Deploy the seed nodes:

kubectl apply -f k8s/cluster/akka-cluster-seed.yaml

Deploy the worker nodes:

kubectl apply -f k8s/cluster/akka-cluster-workers.yaml

Scale:

kubectl scale statefulset akka-seed --replicas=3

Check the logs:

kubectl get pods -A
kubectl logs -f akka-seed-0 | akka-seed-1 | akka-seed-2

Troubleshooting

sbt compile
sbt test
sbt package
sbt run
sbt clean assembly
sbt protobuf:protobufGenerate
sbt docker:stage
tree target/docker/stage
sbt docker:publishLocal
docker images
docker image rm <IMAGE_ID>