Agones:一款基于Kubernetes的开源游戏服务器
Posted 分布式实验室
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Agones:一款基于Kubernetes的开源游戏服务器相关的知识,希望对你有一定的参考价值。
玩家们连接到某种匹配服务,匹配服务(一般通过玩家等级)将玩家匹配分组。
一旦玩家匹配成功,匹配服务通知游戏管理器在服务器集群中提供一个专属游戏进程。
游戏管理器在集群中某台机器上创建专属游戏服务。
玩家们直连到专属服务进程开始游戏。
FROM debian:stretch
RUN useradd -m server
COPY ./bin/game-server /home/server/game-server
RUN chown -R server /home/server &&
chmod o+x /home/server/game-server
USER server
ENTRYPOINT ["/home/server/game-server"]
apiVersion: "stable.agon.io/v1alpha1"
kind: GameServer
metadata:
name: my-game-server
spec:
containerPort: 7654
# Pod template
template:
spec:
containers:
- name: my-game-server-container
image: gcr.io/agon-images/my-game-server:0.1
$ kubectl apply -f gamesever.yaml
gameserver "my-game-server" created
$ kubectl describe gameserver my-game-server
Name: my-game-server
Namespace: default
Labels:
Annotations:
API Version: stable.agones.dev/v1alpha1
Kind: GameServer
Metadata:
Cluster Name:
Creation Timestamp: 2018-02-09T05:02:18Z
Finalizers:
stable.agones.dev
Generation: 0
Initializers:
Resource Version: 13422
Self Link: /apis/stable.agones.dev/v1alpha1/namespaces/default/gameservers/my-game-server
UID: 6760e87c-0d56-11e8-8f17-0800273d63f2
Spec:
Port Policy: dynamic
Container: my-game-server-container
Container Port: 7654
Health:
Failure Threshold: 3
Initial Delay Seconds: 5
Period Seconds: 5
Host Port: 7884
Protocol: UDP
Template:
Metadata:
Creation Timestamp:
Spec:
Containers:
Image: gcr.io/agones-images/my-game-server:0.1
Name: my-game-server-container
Resources:
Status:
Address: 192.168.99.100
Node Name: agones
Port: 7884
State: Ready
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal PortAllocation 3s gameserver-controller Port allocated
Normal Creating 3s gameserver-controller Pod my-game-server-q98sz created
Normal Starting 3s gameserver-controller Synced
Normal Ready 1s gameserver-controller Address and Port populated
https://github.com/GoogleCloudPlatform/agones
https://github.com/GoogleCloudPlatform/agones/issues/70
https://github.com/GoogleCloudPlatform/agones/milestone/2
https://github.com/GoogleCloudPlatform/agones/blob/master/docs/installing_agones.md
以上是关于Agones:一款基于Kubernetes的开源游戏服务器的主要内容,如果未能解决你的问题,请参考以下文章
Kubernetes Dashboard 终结者:KubeSphere
centos7基于kubeadm安装部署Kubernetes (1.15.2)集群
GitOps:一款基于Kubernetes的高速CI/CD框架