Skip to content

Commit

Permalink
add doc for Container Launch Priority (#28)
Browse files Browse the repository at this point in the history
* add doc for Container Launch Priority
  • Loading branch information
chrisliu1995 authored Dec 13, 2022
1 parent 8f226ea commit 3f4c2a3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
34 changes: 34 additions & 0 deletions docs/中文/用户手册/容器启动顺序控制.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## 功能概述

单个游戏服Pod存在多个容器的情况下,有时候会需要对容器的启动顺序有所要求。OKG提供了自定义顺序启动的功能

## 使用示例

在GameServerSet.Spec.GameServerTemplate.spec.containers 中添加 KRUISE_CONTAINER_PRIORITY 环境变量:

```
apiVersion: game.kruise.io/v1alpha1
kind: GameServerSet
# ...
spec:
gameServerTemplate:
spec:
containers:
- name: main
# ...
- name: sidecar
env:
- name: KRUISE_CONTAINER_PRIORITY
value: "1"
# ...
```

- 值的范围在 [-2147483647, 2147483647],不写默认是 0。
- 权重高的容器,会保证在权重低的容器之前启动。
- 相同权重的容器不保证启动顺序。

上述例子中游戏服启动时由于sidecar权重更高,所以先启动sidecar容器,再启动main容器
4 changes: 2 additions & 2 deletions docs/中文/用户手册/自定义服务质量.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ spec:
rollingUpdate:
podUpdatePolicy: InPlaceIfPossible
maxUnavailable: 100%
serviceQualities: # 设置了一个idle的服务质量
- name: idle
serviceQualities: # 设置了一个healthy的服务质量
- name: healthy
containerName: minecraft
permanent: false
#与原生probe类似,本例使用执行脚本的方式探测游戏服是否健康
Expand Down

0 comments on commit 3f4c2a3

Please sign in to comment.