You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-34Lines changed: 28 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,32 +2,23 @@
2
2
3
3
# GameOn! Java Microservices deployment on Kubernetes Cluster
4
4
5
-
This project demonstrates deployment of a Microservices based application [Game On!](https://gameontext.org/#/) on to Kubernetes cluster. Game On! is a throwback text-based adventure built to help you explore microservice architectures and related concepts. GameOn! users start by creating a simple room, the building block of any adventure game. A user can create in text a simple room in any one of various languages in just a few minutes.
5
+
This project demonstrates deployment of a Microservices based application Game On! on to Kubernetes cluster. Game On! is a throwback text-based adventure built to help you explore microservice architectures and related concepts. GameOn! users start by creating a simple room, the building block of any adventure game. A user can create in text a simple room in any one of various languages in just a few minutes.
6
6
7
7
There are several microservices used in this app
8
8
9
-

10
-
11
9
### Core MicroServices:
12
10
13
-
There are five core Java microservices, using [JAX-RS](https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services), [CDI](https://dzone.com/articles/cdi-di-p1) etc. from [MicroProfile](http://microprofile.io) framework spec.
14
-
15
-
-[Player](https://github.com/gameontext/gameon-player): Players, are represented by the player Java microservice service, which provides a public API for CRUD operations, and for managing API tokens.
16
-
-[Auth](https://github.com/gameontext/gameon-auth): Java microservice to allow players to connect and identify themselves via a selected "social login"
17
-
-[Mediator](https://github.com/gameontext/gameon-mediator): The Mediator service is implemented in Java using WebSphere Liberty, and connects players to rooms over Websockets
18
-
-[Map](https://github.com/gameontext/gameon-map): The Map service is a Java EE application running on WebSphere Liberty that provides a public REST API using JAX-RS. It stores data in a NoSQL data store, either couchdb or Cloudant
19
-
-[Room](https://github.com/gameontext/gameon-room): Java based room implementation
20
-
21
-
In addition, Proxy and WebApp complete the core microservices
22
-
23
-
-[Proxy](https://github.com/gameontext/gameon-proxy): HAProxy based, and is responsible for surfacing the collection of APIs as a single facade for the entire application.
24
-
-[WebApp](https://github.com/gameontext/gameon-webapp): Webapp is a simple nginx process that serves the static files that comprise the front-end of the UI.
25
-
11
+
- Proxy: HAProxy based, and is responsible for surfacing the collection of APIs as a single facade for the entire application.
12
+
- WebApp: Webapp is a simple nginx process that serves the static files that comprise the front-end of the UI.
13
+
- Player: Players, are represented by the player Java microservice service, which provides a public API for CRUD operations, and for managing API tokens.
14
+
- Auth: Java microservice to allow players to connect and identify themselves via a selected "social login"
15
+
- Mediator: The Mediator service is implemented in Java using WebSphere Liberty, and connects players to rooms over Websockets
16
+
- Map: The Map service is a Java EE application running on WebSphere Liberty that provides a public REST API using JAX-RS. It stores data in a NoSQL data store, either couchdb or Cloudant
17
+
Room: Java based room implementation
26
18
27
19
### Platform Services:
28
-
29
-
-[Amalgam8](https://www.amalgam8.io/): Content-based Routing Fabric for Polyglot Microservices. Amalgam8 supplies Registry, and a Controller, via which it implements the Service Discovery, and Service Proxying. In addition, there ia an Amalgam8 sidecar associated with each microservice, which automatically registers the microservice with the registry.
30
-
-[Kafka](https://kafka.apache.org): Publish/Subscribe solution used by Amalgam8
20
+
- Amalgam8: Amalgam8 supplies Registry, and a Controller, via which it implements the Service Discovery, and Service Proxying
21
+
- Kafka: Publish/Subscribe solution used by Amalgam8
31
22
32
23
Everything would be hosted on a Kubernetes Cluster where you can access your own GameOn app from anywhere.
33
24
@@ -54,8 +45,12 @@ Please follow the [Toolchain instructions](https://github.com/IBM/container-jour
54
45
- 5.2 [Add Rooms](#52-add-rooms)
55
46
56
47
# 1. Modify the Core services yaml files
57
-
First, you'll need to update the yaml files for the **core services** and **setup.yaml**.
58
-
You will need to get the Public IP address of your cluster.
48
+
You can also use the script provided that replaces the default values to the IP of your current cluster.
49
+
*`./scripts/replace_ip_linux.sh` for linux
50
+
*`./scripts/replace_ip_OSX.sh` for macOS
51
+
52
+
Or alternatively:
53
+
Get the Public IP address of your cluster.
59
54
```bash
60
55
$ kubectl get nodes
61
56
NAME STATUS AGE
@@ -67,10 +62,6 @@ Take note of the IP address. Go to the **core** folder and change the following
67
62
> value : https://169.47.241.yyy:30443/players/v1/accounts**TO ->** value : https://169.xx.xxx.xxx:30443/players/v1/accounts
68
63
> ...
69
64
70
-
You can also use the script provided that replaces the default values to the IP of your current cluster.
71
-
*`./replace_ip_linux.sh` for linux
72
-
*`./replace_ip_OSX.sh` for macOS
73
-
74
65
```yaml
75
66
Core yaml files should look like this. Change the following env variables
76
67
spec:
@@ -106,17 +97,20 @@ spec:
106
97
...
107
98
```
108
99
# 2. Create Volumes in your Cluster
109
-
You would need to create a volume for your cluster. You can use the provided yaml file. The volume will also be used by the core services. This would contain some required keystores and server configurations.
100
+
You would need to create a volume for your cluster. You can use the provided yaml file. The required keystores will be stored in this volume. The volume will also be used by the core services.
110
101
```bash
111
102
$ kubectl create -f local-volumes.yaml
112
103
persistent volumes "local-volume-1" created
113
104
persistent volumes "keystore-claim" created
114
105
```
115
106
116
-
You can now create the required keystores using the **setup.yaml** file. This will create a Pod and create the keystores. Once it is done, the Pod will terminate. You may delete the pod after.
107
+
You can now create the required keystores using the **setup.yaml** file. This will create a Pod and create the keystores.
117
108
```bash
118
109
$ kubectl create -f setup.yaml
119
110
```
111
+
112
+
Once it is done, the Pod will not run again. You can delete the Pod after using `kubectl delete pod setup` (optional).
113
+
120
114
If you want to confirm that the Pod has successfully imported the keystores, you can view the Pod's logs.
You can now create the Platform services and deployments of the app.
133
+
You can now create the [Platform services](#platform-services) and deployments of the app.
140
134
```bash
141
135
$ kubectl create -f platform
142
136
OR alternatively
@@ -155,8 +149,8 @@ If both of them outputs 200, you can proceed to the next step.
155
149
> Note: It can take around 1-2 minutes for the Pods to setup completely.
156
150
157
151
# 4. Create the Core Services
158
-
Finally, you can create the Core services and deployments of the app.
159
-
*(If you want to have social logins, please follow the steps [here](#a-adding-social-logins) before deploying the core services)*
152
+
Finally, you can create the **[Core services](#core-microservices)** and deployments of the app.
153
+
*(If you want to have social logins, please follow the steps [here](#a-adding-social-logins) before deploying the [core services](#core-microservices))*
To verify if the core services has finished setting up, you would need to check the logs of the Pod of the proxy. You can get the Pod name of the proxy using **kubectl get pods**
164
+
To verify if the [core services](#core-microservices) has finished setting up, you would need to check the logs of the Pod of the proxy. You can get the Pod name of the proxy using **kubectl get pods**
171
165
```bash
172
166
kubectl logs proxy-***-**
173
167
```
@@ -198,7 +192,7 @@ Now that you have successfully deployed your own app in the Bluemix Kubernetes C
198
192
You may want to add social logins so you and your friends can explore the rooms together.
199
193
To add social logins you would need to have developer accounts on the social app you want to use.
200
194
201
-
> You will need to redeploy your **Core** services with the your own modified yaml files. The next step will show you where to add your API Keys.
195
+
> You will need to redeploy your **[Core services](#core-microservices)** with the your own modified yaml files. The next step will show you where to add your API Keys.
202
196
203
197
204
198
## Github
@@ -212,7 +206,7 @@ For the Authorization callback URL, you will need to put the IP address and the
212
206
213
207
You can edit that in the GitHub later if you made a new cluster.
214
208
Now, take note of the **Client ID** and **Client Secret** of the app.
215
-
You will need to add this in the environment variables on the yaml files of your **Core services**
209
+
You will need to add this in the environment variables on the yaml files of your **[Core services](#core-microservices)**
216
210
```yaml
217
211
...
218
212
- name: GITHUB_APP_ID
@@ -236,7 +230,7 @@ For the Authorization callback URL, you will need to put the IP address and the
236
230
> https://169.xxx.xxx.xxx:30443/auth/TwitterAuth
237
231
238
232
Go to the Keys and Access Tokens section of the twitter application you just registered and take note of the **Consumer Key** and **Consumer Secret** of the app.
239
-
You will need to add this in the environment variables on the yaml files of your **Core services**
233
+
You will need to add this in the environment variables on the yaml files of your **[Core services](#core-microservices)**
0 commit comments