-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This provides examples of Quilkin being used on Agones, with Quilkin being used a sidecar with no filters, as well as with a compression filter example. Work on #228
- Loading branch information
1 parent
bda096f
commit c315088
Showing
4 changed files
with
182 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Agones & Xonotic Example | ||
|
||
This for contain example of running [Xonotic](https://xonotic.org/) within an [Agones](https://agones.dev/) cluster. | ||
|
||
To interact with the demo, you will need to download the client. | ||
|
||
## Sidecar with no filter | ||
|
||
Run `kubectl apply -f https://github.com/googleforgames/quilkin/blob/main/examples/agones-xonotic/sidecar.yaml` to | ||
create a Fleet of Xonotic dedicated game servers, with traffic processed through a Quilkin sidecar proxy. | ||
|
||
This is particularly useful if you want to take advantage of the inbuilt metrics that Quilkin provides without | ||
having to alter your dedicated game server. | ||
|
||
Connect to the Agones hosted Xonotic server via the "Multiplayer > Address" field. | ||
|
||
## Sidecar with compression filter | ||
|
||
Run `kubectl apply -f https://github.com/googleforgames/quilkin/blob/main/examples/agones-xonotic/sidecar-compress.yaml` | ||
to create a Fleet of Xonotic dedicated game servers, with traffic processed through a Quilkin sidecar proxy, | ||
that is configured to decompresses UDP traffic with the [Snappy](https://github.com/google/snappy) compression format. | ||
|
||
Instead of connecting Xonotic directly, take the IP and port from the Agones hosted dedicated server, and replace the | ||
`${GAMESERVER_IP}` and `${GAMESERVER_PORT}` values in a local copy of `client-compress.yaml`. Run this configuration | ||
locally as: | ||
|
||
`quilkin -f ./client-compress.yaml` | ||
|
||
From there connect to the local client proxy on "127.0.0.1:7000" via the "Multiplayer > Address" field in the | ||
Xonotic client, and Quilkin will take care of compressing the data for you without having to change either the | ||
client or the dedicated game server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
version: v1alpha1 | ||
static: | ||
filters: | ||
- name: quilkin.extensions.filters.compress.v1alpha1.Compress | ||
config: | ||
on_read: COMPRESS | ||
on_write: DECOMPRESS | ||
mode: SNAPPY | ||
endpoints: | ||
- name: xonotic | ||
address: ${GAMESERVER_IP}:${GAMESERVER_PORT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: quilkin-config-compress | ||
data: | ||
quilkin.yaml: | | ||
version: v1alpha1 | ||
proxy: | ||
port: 26001 | ||
static: | ||
filters: | ||
- name: quilkin.extensions.filters.compress.v1alpha1.Compress | ||
config: | ||
on_read: DECOMPRESS | ||
on_write: COMPRESS | ||
mode: SNAPPY | ||
endpoints: | ||
- name: xonotic | ||
address: 127.0.0.1:26000 | ||
--- | ||
apiVersion: "agones.dev/v1" | ||
kind: Fleet | ||
metadata: | ||
name: xonotic-sidecar-compress | ||
spec: | ||
replicas: 2 | ||
template: | ||
spec: | ||
container: xonotic | ||
ports: | ||
- name: default | ||
containerPort: 26001 | ||
health: | ||
initialDelaySeconds: 30 | ||
periodSeconds: 60 | ||
template: | ||
spec: | ||
containers: | ||
- name: xonotic | ||
image: gcr.io/agones-images/xonotic-example:0.8 | ||
- name: quilkin | ||
image: us-docker.pkg.dev/quilkin/release/quilkin:0.1.0 | ||
volumeMounts: | ||
- name: config | ||
mountPath: "/etc/quilkin" | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: quilkin-config-compress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# | ||
# Copyright 2021 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: quilkin-config | ||
data: | ||
quilkin.yaml: | | ||
version: v1alpha1 | ||
proxy: | ||
port: 26001 | ||
static: | ||
endpoints: | ||
- name: xonotic | ||
address: 127.0.0.1:26000 | ||
--- | ||
apiVersion: "agones.dev/v1" | ||
kind: Fleet | ||
metadata: | ||
name: xonotic-sidecar | ||
spec: | ||
replicas: 2 | ||
template: | ||
spec: | ||
container: xonotic | ||
ports: | ||
- name: default | ||
containerPort: 26001 | ||
health: | ||
initialDelaySeconds: 30 | ||
periodSeconds: 60 | ||
template: | ||
spec: | ||
containers: | ||
- name: xonotic | ||
image: gcr.io/agones-images/xonotic-example:0.8 | ||
- name: quilkin | ||
image: us-docker.pkg.dev/quilkin/release/quilkin:0.1.0 | ||
volumeMounts: | ||
- name: config | ||
mountPath: "/etc/quilkin" | ||
volumes: | ||
- name: config | ||
configMap: | ||
name: quilkin-config |