openkruise / kruise-game

Game Servers Management on Kubernetes
https://openkruise.io/kruisegame/introduction
Apache License 2.0
295 stars 41 forks source link

reserveGameServerIds字段在创建gss时不生效 #146

Open shensl opened 5 months ago

shensl commented 5 months ago

使用以下yaml创建gss不能实现创建预期编号为[1-4]的gs,最终gs与pod编号仍为[0-3]

apiVersion: game.kruise.io/v1alpha1
kind: GameServerSet
metadata:
  name: minecraft
spec:
  replicas: 4
  reserveGameServerIds: [0]
  gameServerTemplate:
    spec:
      containers:
        - name: minecraft
          image: registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2

查看events发现编号为4的pod被删除

LAST SEEN   TYPE      REASON                                          OBJECT                    MESSAGE
3m7s        Normal    Scheduled                                       pod/minecraft-0           Successfully assigned default/minecraft-0 to ssl-k8s-126-3
3m6s        Normal    Pulling                                         pod/minecraft-0           Pulling image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2"
3m5s        Normal    Pulled                                          pod/minecraft-0           Successfully pulled image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2" in 353.010049ms (685.430123ms including waiting)
3m5s        Warning   ContainersNotReady                              gameserver/minecraft-0    containers with unready status: [minecraft]
3m5s        Normal    Created                                         pod/minecraft-0           Created container minecraft
3m5s        Normal    Started                                         pod/minecraft-0           Started container minecraft
3m4s        Normal    GsStateChanged                                  gameserver/minecraft-0    State turn from Creating to Ready
3m7s        Normal    Scheduled                                       pod/minecraft-1           Successfully assigned default/minecraft-1 to ssl-k8s-126-3
3m7s        Warning   ContainersNotReady                              gameserver/minecraft-1    containers with unready status: [minecraft]
3m6s        Normal    Pulling                                         pod/minecraft-1           Pulling image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2"
3m6s        Normal    Pulled                                          pod/minecraft-1           Successfully pulled image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2" in 338.014ms (338.119396ms including waiting)
3m6s        Normal    Created                                         pod/minecraft-1           Created container minecraft
3m6s        Normal    Started                                         pod/minecraft-1           Started container minecraft
3m5s        Normal    GsStateChanged                                  gameserver/minecraft-1    State turn from Creating to NotReady
3m3s        Normal    GsStateChanged                                  gameserver/minecraft-1    State turn from NotReady to Ready
3m7s        Normal    Scheduled                                       pod/minecraft-2           Successfully assigned default/minecraft-2 to ssl-k8s-126-3
3m7s        Warning   ContainersNotReady                              gameserver/minecraft-2    containers with unready status: [minecraft]
3m7s        Normal    Pulling                                         pod/minecraft-2           Pulling image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2"
3m6s        Normal    Pulled                                          pod/minecraft-2           Successfully pulled image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2" in 299.383572ms (299.388314ms including waiting)
3m6s        Normal    Created                                         pod/minecraft-2           Created container minecraft
3m6s        Normal    Started                                         pod/minecraft-2           Started container minecraft
3m5s        Normal    GsStateChanged                                  gameserver/minecraft-2    State turn from Creating to Ready
3m7s        Normal    Scheduled                                       pod/minecraft-3           Successfully assigned default/minecraft-3 to ssl-k8s-126-3
3m7s        Warning   ContainersNotReady                              gameserver/minecraft-3    containers with unready status: [minecraft]
3m6s        Normal    Pulling                                         pod/minecraft-3           Pulling image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2"
3m6s        Normal    Pulled                                          pod/minecraft-3           Successfully pulled image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2" in 349.925159ms (616.176777ms including waiting)
3m6s        Normal    Created                                         pod/minecraft-3           Created container minecraft
3m6s        Normal    Started                                         pod/minecraft-3           Started container minecraft
3m4s        Normal    GsStateChanged                                  gameserver/minecraft-3    State turn from Creating to Ready
3m7s        Normal    Scheduled                                       pod/minecraft-4           Successfully assigned default/minecraft-4 to ssl-k8s-126-3
3m6s        Warning   ContainersNotReady                              gameserver/minecraft-4    containers with unready status: [minecraft]
3m6s        Normal    Pulling                                         pod/minecraft-4           Pulling image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2"
3m5s        Normal    Pulled                                          pod/minecraft-4           Successfully pulled image "registry.cn-hangzhou.aliyuncs.com/acs/minecraft-demo:1.12.2" in 363.68806ms (772.307662ms including waiting)
3m5s        Normal    Created                                         pod/minecraft-4           Created container minecraft
3m5s        Normal    Started                                         pod/minecraft-4           Started container minecraft
3m4s        Normal    Killing                                         pod/minecraft-4           Stopping container minecraft
3m3s        Normal    GsStateChanged                                  gameserver/minecraft-4    State turn from Creating to Deleting
2m32s       Warning   ContainersNotReady; ContainerTerminated:Error   gameserver/minecraft-4    containers with unready status: [minecraft];  ExitCode: 137
3m7s        Normal    CreateWorkload                                  gameserverset/minecraft   created Advanced StatefulSet
3m7s        Normal    Scale                                           gameserverset/minecraft   scale from 0 to 4
3m7s        Normal    SuccessfulCreate                                statefulset/minecraft     create Pod minecraft-1 in StatefulSet minecraft successful
3m7s        Normal    SuccessfulCreate                                statefulset/minecraft     create Pod minecraft-2 in StatefulSet minecraft successful
3m7s        Normal    SuccessfulCreate                                statefulset/minecraft     create Pod minecraft-3 in StatefulSet minecraft successful
3m7s        Normal    SuccessfulCreate                                statefulset/minecraft     create Pod minecraft-4 in StatefulSet minecraft successful
3m7s        Normal    SuccessfulCreate                                statefulset/minecraft     create Pod minecraft-0 in StatefulSet minecraft successful
3m7s        Normal    SuccessfulDelete                                statefulset/minecraft     delete Pod minecraft-4 in StatefulSet minecraft successful
LubinWang commented 1 month ago

scaleStrategy: scaleDownStrategyType: ReserveIds