/akka-kubernetes-example

Primary LanguageJavaApache License 2.0Apache-2.0

Introduction

This is an example code and configuration to deploy Akka in Kubernetes using Statefulset for Akka seed nodes, and Deployment for Akka worker nodes.

Special thanks to Johan and Ola for teaching me about Akka at JFokus 2017.

See Clustering Akka in Kubernetes article.

Prerequisite

You have a working Kubernetes 1.5 cluster. You can try Minikube, or Google Container Engine for multi-node deployment.

Installation

  1. Deploy the seed nodes: kubectl apply -f kubernetes/akka-seed.yaml
  2. Deploy the worker nodes: kubectll apply -f kubernetes/akka-workers.yaml

Or, deploy everything in one shot: `kubectl apply -f kubernetes/

Example Usage

  • Scale seed nodes: kubectl scale statefulset akka-seed --replicas=3
  • Scale worker nodes: kubectl scale deployment akka-worker --replicas=4
  • See logs: kubectl logs -f akka-seed-0