https://github.com/wwitzel3/agones-websocket
A simple websocket example using GoogleCloudPlatform/agones (agones.dev)
https://github.com/wwitzel3/agones-websocket
agones go vuejs
Last synced: about 1 year ago
JSON representation
A simple websocket example using GoogleCloudPlatform/agones (agones.dev)
- Host: GitHub
- URL: https://github.com/wwitzel3/agones-websocket
- Owner: wwitzel3
- Created: 2018-07-14T03:41:31.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-15T11:55:25.000Z (almost 8 years ago)
- Last Synced: 2025-03-30T08:08:05.664Z (over 1 year ago)
- Topics: agones, go, vuejs
- Language: Go
- Homepage:
- Size: 21.1 MB
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

This is for exploring GoogleCloudPlatform agones.
More info at https://github.com/GoogleCloudPlatform/agones.
This example is a simple Ping/Pong websocket example.
The websocket could be used to stream game data to a JS game client.
GKE
===
Start a new cluster. I just use the defaults. Run the `gcloud` command to add the cluster to your kubeconfig.
```
kubectl create clusterrolebinding serviceaccounts-cluster-admin \
--clusterrole=cluster-admin \
--group=system:serviceaccounts
```
```
kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole cluster-admin --user `gcloud config get-value account`
```
```
gcloud compute firewall-rules create game-server-firewall \
--allow tcp:7000-8000 \
--description "agones-simple example firewall to allow game server tcp traffic"
```
Install agones
==============
`kubectl apply -f https://github.com/GoogleCloudPlatform/agones/raw/release-0.2.0/install/yaml/install.yaml`
Building
========
Find and replace `YOUR_PROJECT_ID` in the Go and YAML files with your `gcr.io` repository project ID. I used the same project that my GKE cluster was created in to make accessing the image repository easy.
`sed -i 's/YOUR_PROJECT_ID/example-123456/g' *`
`make build`
`make build-image`
Push Images
===========
`make push-image`
Deploying
=========
`kubectl apply -f yaml/launcher.yaml`
`kubectl get -n simple-launcher service`
Testing
=======
Now visit the simple-launcher service. You should see a link to create a new gameserver. After clicking the link, a new gameserver will be created.
The details for the gameserver will load and you will get another link to access the new gameserver instance.
The gameserver instance is a VueJs/WebSocket single page that has a Ping/Pong app that talks to the gameserver. It also has a button for stoppind the gameserver.