Git Product home page Git Product logo

mfactory-lab / lagom-on-kube Goto Github PK

View Code? Open in Web Editor NEW
58.0 6.0 18.0 228 KB

This tutorial describes how to bootstrap a production-ready Lagom microservices cluster in a Kubernetes environment.

Home Page: https://www.mfactory.de/

License: Apache License 2.0

Python 6.78% Scala 93.22%
lagom kubernetes microservice-framework microservice lightbend kubernetes-cluster service-discovery lagom-services docker telegram-bot

lagom-on-kube's Introduction

Lagom on Kube

This tutorial describes how to bootstrap a production-ready Lagom microservices cluster in a Kubernetes environment.

alt lagom on kube

The Problem

Lagom is a great java- and scala-based reactive microservices framework. Lagom is free to use in both development and production. However, as detailed later in this doc, deploying lagom requires some extra weight lifting by the end user or using Lightbend's ConductR (which is free to use up to three nodes).

With this tutorial, you can bootstrap a Kubernetes cluster hosting Lagom microservices, which is free-to-use, however production-ready.

The Lagom framework lacks following fuctionality and attributes required for a production-ready microservices framework:

  • Service orchestration
  • Scalability
  • Monitoring
  • Resilience
  • Load balancing
  • Service discovery

Turns out, all of the above can be achieved with Docker and Kubernetes. (I'm pretty sure it's also possible using Docker Swarm or Apache Mesos, but those ways are outside of the scope of this tutorial.)

The Solution

  • Service orchestration: we package all of the Lagom services into Docker containers, which are then 'orchestrated' (i.e. deployed, scaled, managed, etc.) through standard Kubernetes tools.

  • Scalability is provided on two levels

    • Within a Kubernetes cluster, scaling is performed by Deployments and Replication controllers
    • AWS offers Auto Scaling group for further scalability when a Kubernetes cluster hits its limit
  • Monitoring is provided on two levels as well

    • Heapster (InfluxDB and Grafana) to monitor containers and nodes
    • New Relic to monitor everything at service level
  • Resilience

    • Kubernetes Pods can be configured to track the health status of Docker containers
    • Deployments keep number of active containers in line with current load
  • Load balancing is provided by Kubernetes services which select a Pod randomly for each request (more complex load balancing strategies are available using Ingress or an external load balancer, however these methods are outside of the scope of this document)

  • Service Discovery was the only part which had to be implemented, not just configured. It is based on the free-to-use Lagom develempent-mode service register and received a number of improvements making it resilient, persistent and compatible with the Kubernetes architecture.

The Technologies

  • AWS as a cloud platform
  • kops to bootstrap Kubernetes on AWS
  • Kubernetes for service orchestration
  • Ansible for configuration management
  • Docker as a container
  • Lagom as a microservices framework
  • Heapster for container and node monitoring
  • New Relic for application monitoring
  • Cassandra as a persistent storage for service registry

The Description

The Demo infrastructure is described in this document

lagom-on-kube's People

Contributors

alexanderray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lagom-on-kube's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.