chat-ui |
directory containing the code of the stateless service |
deploy |
directory containing the yaml files to deploy all the services composing the Chat application. The target cluster could be your own Kubernetes cluster or Akka Serverless |
The code of the backend services Friends
and Presence
is separate from the UI code. This is intentional to demonstrate the polyglot aspect of Cloudstate services. They can seamlessly interact regardless of the programming language used to implement the service. Below are the available implementations. You can choose any combination for deployment. For example, Friends
service in JavaScript and Presence
service in Java.
You must package your services into docker images and publish these images in a Docker registry. At deployment time, the Kubernetes cluster will pull the images from this registry. You can get a free Docker registry at https://hub.docker.com/
For the deployment, there are two possible choices. Below we highlight the main characteristics of each deployment approach. Details about prerequisites and infrastructure preparation would be discussed further in the Deployment section.
This deployment approach doesn’t require any local infrastructure. Akka Serverless, which is a kind of "Cloudstate-as-a-Service", will take care of the hosting, configuration and maintenance of your services. The deployment prodedure is pretty minimal:
-
Open an account with Akka Serverless
-
Install the "Akka Serverless CLI" tool
akkasls
And that’s it. Then you just use akkasls
to deploy the your services that you had published in your Docker registry.
In case you prefer to host your own services, you need to provide a Kubernetes cluster. This cluster could be local or cloud-based and must fulfill the following requirements:
-
A Kubernetes cluster, with 1.13 as the minimum required version
-
An ingress controller with a Layer7 Load Balancer ability
-
A working knowledge of Kubernetes to be able to manage your cluster and to troubleshoot, should any issue specific to your Kubernetes cluster arise.
Before beginning the deployment, each of the various microservices composing the Chat application must be packaged into their own docker image, and published to your Docker registry.
You can user our hosted UI here https://static.cloudstate.com/js-chat/index.html
We have built, tested and published 2 dockers images of the 2 services: Friends, Presence. Now we are ready to deploy the Chat application. There are two possible tracks for deploying your services: