The following project is created to test Lightbend Orchestration for Kubernetes from Play Scala and Lagom Scala's perspective.
The project seeks to assert the following functionality:
- Deploying Play Scala and Lagom Scala application into Kubernetes.
- Ensuring Play Scala can lookup Lagom Scala application using
ServiceLocator
provided by the reactive-lib project. - Ensuring Lagom Scala can establish a fully-formed Akka cluster using
akka-cluster-bootstrap
provided by the reactive-lib project. - Ensuring Lagom Scala can lookup another Lagom application using
LagomServiceLocator
provided by the reactive-lib project.
The project is split into 3 parts:
frontend
: this is the Play Scala frontend.clustered-api
andclustered-impl
: this is the Lagom Scala application which will form an Akka cluster, and message to the actor within the application will be sharded using Akka Cluster Sharding.simple-api
andsimple-impl
: this is simple, hello-world like Lagom Scala application.
Only frontend
will be ingressed, and both Lagom applications will not be exposed (i.e. not accessible outside of Kubernetes).
The frontend
application will provide these endpoints.
- The
/
endpoint simply returns the wordHello
.
+--------------+ +----------------+
| + -------> | |
| frontend | | simple-impl |
| | <------- + |
+--------------+ +----------------+
frontend
will locatesimple-impl
service, and then will invoke the located endpoint which returns a simple text.- The returned text from
simple-impl
service is then returned tofrontend
. frontend
returns this text to the caller.
+--------------+ +-----------------+
| + -------> | |
| frontend | | clustered-impl |
| | <------- + |
+--------------+ +-----------------+
frontend
will locateclustered-impl
service, and then will invoke the located endpoint which returns a simple text.- The returned text from
clustered-impl
service is then returned tofrontend
. frontend
returns this text to the caller.
+--------------+ +-----------------+ +----------------+
| + -------> | + -------> | |
| frontend | | clustered-impl | | simple-impl |
| | <------- + | <------- + |
+--------------+ +-----------------+ +----------------+
frontend
will locateclustered-impl
service, and then will invoke the located endpoint.- The located endpoint within
clustered-impl
will then invokesimple-impl
using the client API provided bysimple-api
. - The returned text from
simple-impl
is then returned toclustered-impl
. clustered-impl
returns this text tofrontend
.frontend
returns this text to the caller.
frontend
will perform DNS SRV lookup for a given:name
.- The
:name
can be the name of the service registered in Kubernetes, or the SRV name registered in Kube-DNS. - If found, the list of addresses will be returned, else
404
is returned.
frontend
will perform DNS SRV lookup for a given:name
of a service, and the:endpoint
name.- If found, the list of addresses will be returned, else
404
is returned.