Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

Commit 5f26ea7

Browse files
committed
Added Rooms
1 parent 0e4a51b commit 5f26ea7

File tree

4 files changed

+55
-8
lines changed

4 files changed

+55
-8
lines changed

README.md

Lines changed: 55 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# kubernetes-container-service-gameon-java-microservice
44

5-
This project demonstrates deployment of a Microservices based application Game On! on to Kubernetes cluster service from Bluemix. 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. With the tutorials available at the [GameOn! website](https://gameontext.org), 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 service from Bluemix. 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. With the tutorials available at the [GameOn! website](https://book.gameontext.org), a user can create in text a simple room in any one of various languages in just a few minutes.
66

77
There are several microservices used in this app ranging from **couchdb, redis, to frontend tier services**. Everything would be hosted in Bluemix Kubernetes Container Service where you can access your own GameOn app from anywhere.
88

@@ -31,7 +31,7 @@ Please follow the [Toolchain instructions](https://github.com/IBM/container-jour
3131
5. [Explore your GameOn App](#5-explore-your-gameon-app)
3232

3333
A. [Adding Social Logins](#a-adding-social-logins)
34-
34+
B. [Adding Rooms](#b-adding-rooms)
3535

3636
# 1. Modify the yaml files
3737
First, you'll need to update the yaml files for the **core services** and **setup.yaml**.
@@ -113,21 +113,31 @@ Import command completed: 104 entries successfully imported, 0 entries failed o
113113
```
114114

115115
# 3. Create the Platform Services
116-
You can now create the Platform services and deployments of the app. You can use the script provided to create the services and deployments in one command or, alternatively, you can use **kubectl create -f** with every yaml file in the platform directory.
116+
You can now create the Platform services and deployments of the app.
117117
```bash
118-
$ ./platform-services.sh
118+
$ kubectl create -f platform
119119
OR alternatively
120120
$ kubectl create -f platform/controller.yaml
121121
$ kubectl create -f platform/<file-name>.yaml
122122
...
123123
$ kubectl create -f platform/registry.yaml
124124
```
125+
126+
To check if the control plane (controller and registry) is up:
127+
```bash
128+
$ curl -w "%{http_code}" "<Public IP of your cluster>:31200/health" -o /dev/null
129+
$ curl -w "%{http_code}" "<Public IP of your kubernetes>:31300/uptime" -o /dev/null
130+
```
131+
If both of them outputs 200, you can proceed to the next step.
125132
> Note: It can take around 1-2 minutes for the Pods to setup completely.
126133
127134
# 4. Create the Core Services
128-
Finally, you can create the Core services and deployments of the app. Like creating the platform services, you can use the script provided or use **kubectl create -f** with every yaml file in the core directory.
135+
Finally, you can create the Core services and deployments of the app.
136+
*(If you want to have social logins, please follow the steps [here](#a-adding-social-logins) before deploying the core services)*
137+
138+
129139
```bash
130-
$ ./core-services.sh
140+
$ kubectl create -f core
131141
OR alternatively
132142
$ kubectl create -f core/auth.yaml
133143
$ kubectl create -f core/<file-name>.yaml
@@ -138,11 +148,13 @@ To verify if the core services has finished setting up, you would need to check
138148
```bash
139149
kubectl logs proxy-***-**
140150
```
141-
You should look for the map, auth, and room servers. Confirm if they are UP.
151+
You should look for the map, auth, mediator, player and room servers. Confirm if they are UP.
142152
```bash
143153
[WARNING] 094/205214 (11) : Server room/room1 is UP, reason: Layer7 check passed ...
144154
[WARNING] 094/205445 (11) : Server auth/auth1 is UP, reason: Layer7 check passed ...
145155
[WARNING] 094/205531 (11) : Server map/map1 is UP, reason: Layer7 check passed ...
156+
[WARNING] 094/205531 (11) : Server mediator/mediator1 is UP, reason: Layer7 check passed ...
157+
[WARNING] 094/205531 (11) : Server player/player1 is UP, reason: Layer7 check passed ...
146158
```
147159
> It can take around 5-10 minutes for these services to setup completely.
148160
@@ -161,7 +173,11 @@ Now that you have successfully deployed your own app in the Bluemix Kubernetes C
161173

162174
# A. Adding Social Logins
163175
You may want to add social logins so you and your friends can explore the rooms together.
164-
To add social logins you would need to have developer accounts on the social app you want to use.
176+
To add social logins you would need to have developer accounts on the social app you want to use.
177+
178+
> 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.
179+
180+
165181
## Github
166182
You can register your application in this link: [New OAuth Application](https://github.com/settings/applications/new)
167183
![Github](images/github.png)
@@ -207,3 +223,34 @@ You will need to add this in the environment variables on the yaml files of your
207223
...
208224
```
209225
> The application uses the keys(name) **TWITTER_CONSUMER_KEY** and **TWITTER_CONSUMER_SECRET** and must exactly match these in the core yaml files.
226+
227+
# B. Adding Rooms
228+
229+
You can build your own rooms by following [**this guide**](https://gameontext.gitbooks.io/gameon-gitbook/content/walkthroughs/createRoom.html) by the GameOn team. They have some sample rooms written in Java, Swift, Go, and more.
230+
231+
In this journey, you will deploy the sample rooms written in **Java** and **Swift**. You will deploy it in the same cluster as your GameOn App.
232+
233+
You can create these rooms by executing
234+
```bash
235+
$ kubectl create -f sample-rooms
236+
```
237+
238+
To register the deployed rooms in the cluster, you will need to use the UI of your app.
239+
* Click on the Registered Rooms button at the top right.
240+
![addroom](images/addroom1.png)
241+
242+
* Enter the necessary information of the room. (*Leave the Github Repo and Health Endpoint fields blank.*) Then click `Register`
243+
> Note: In the samples, the Java Room uses port 9080, while the Swift room uses port 8080.
244+
245+
![addroom](images/addroom2.png)
246+
![addroom](images/addroom3.png)
247+
* You now have successfully registered your rooms in your Map. You can go to them directly by typing these commands in the UI: `/listmyrooms` and use the id in `/teleport <id-of-the-room>`
248+
You can learn more about the details of registering a room [**here**](https://gameontext.gitbooks.io/gameon-gitbook/content/walkthroughs/registerRoom.html).
249+
250+
## References
251+
252+
* [GameOn](https://gameontext.org) - The original game on app [deployed using Dockers](https://book.gameontext.org/walkthroughs/local-docker.html)
253+
254+
## License
255+
256+
[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0)

images/addroom1.png

163 KB
Loading

images/addroom2.png

238 KB
Loading

images/addroom3.png

230 KB
Loading

0 commit comments

Comments
 (0)