Skip to content

Commit

Permalink
add more details for kruise-game CRD (#190)
Browse files Browse the repository at this point in the history
Signed-off-by: ChrisLiu <chrisliu1995@163.com>
  • Loading branch information
chrisliu1995 committed Jul 2, 2024
1 parent 19c7f27 commit d228740
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type GameServerSetSpec struct {

```
type GameServerTemplate struct {
// 继承至PodTemplateSpec的所有字段
// 继承至PodTemplateSpec的所有字段,字段详情参考 https://pkg.go.dev/k8s.io/api/core/v1#PodTemplateSpec
corev1.PodTemplateSpec `json:",inline"`
// 对持久卷的请求和声明
Expand Down Expand Up @@ -122,7 +122,7 @@ type ScaleStrategy struct {

```
type ServiceQuality struct {
// 继承至corev1.Probe所有字段,此处指定探测方式
// 继承至corev1.Probe所有字段,此处指定探测方式,字段详情参考 https://pkg.go.dev/k8s.io/api/core/v1#Probe
corev1.Probe `json:",inline"`
// 自定义服务质量的名称,区别定义不同的服务质量
Expand Down Expand Up @@ -216,7 +216,13 @@ type GameServerSetStatus struct {

```
type GameServerSpec struct {
// 游戏服运维状态,表示业务相关的游戏服状态,目前可指定的状态有:None / WaitToBeDeleted / Maintaining。默认为None
// 游戏服运维状态,表示业务相关的游戏服状态,可以由用户定义为任何值。
// OKG提供了一些保留值,有着特殊含义,包括:
// None —— 默认值,代表不存在任何异常和特殊状态
// WaitToBeDeleted —— gs缩容优先级最高,且配置自动伸缩策略后会被自动回收
// Maintaining —— gs缩容优先级最低
// Allocated —— gs缩容优先级大于Maintaining,小于None。通常代表gs已经被分配,在游戏匹配场景下可以使用。
// Kill —— 设置Kill的gs将被OKG控制器直接删除
OpsState OpsState `json:"opsState,omitempty"`
// 更新优先级,优先级高则优先被更新
Expand Down
18 changes: 11 additions & 7 deletions kruisegame/user-manuals/crd-field-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ type GameServerSetSpec struct {

#### GameServerTemplate

```yaml
```
type GameServerTemplate struct {
// All fields inherited from PodTemplateSpec.
// All fields inherited from PodTemplateSpec. More details: https://pkg.go.dev/k8s.io/api/core/v1#PodTemplateSpec
corev1.PodTemplateSpec `json:",inline"`
// Requests and claims for persistent volumes.
Expand Down Expand Up @@ -159,7 +159,7 @@ type ScaleStrategy struct {

```
type ServiceQuality struct {
// Inherits all fields from corev1.Probe
// Inherits all fields from corev1.Probe. More details: https://pkg.go.dev/k8s.io/api/core/v1#Probe
corev1.Probe `json:",inline"`
// Custom name for the service quality, distinguishes different service qualities that are defined.
Expand Down Expand Up @@ -213,7 +213,7 @@ type KVParams struct {

### GameServerSetStatus

```yaml
```
type GameServerSetStatus struct {
// The iteration version of the GameServerSet observed by the controller.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
Expand Down Expand Up @@ -255,9 +255,13 @@ type GameServerSetStatus struct {

```
type GameServerSpec struct {
// The O&M state of the game server, not pod runtime state, more biased towards the state of the game itself.
// Currently, the states that can be specified are: None / WaitToBeDeleted / Maintaining.
// Default is None
// The O&M state of the game server, not pod runtime state, more biased towards the state of the game itself. The states can be any user-defined value.
// At the same time, OKG retains some opsState values, which have different meanings and functions, including:
// None - the default value, indicating that there are no exceptions or special states
// WaitToBeDeleted - gs has the highest scaling priority and will be automatically recycled after configuring the automatic scaling policy
// Maintaining —— gs scaling has the lowest priority
// Allocated —— gs reduction priority is greater than Maintaining and less than None
// Kill - gs set to Kill will be deleted
OpsState OpsState `json:"opsState,omitempty"`
// Update priority. If the priority is higher, it will be updated first.
Expand Down

0 comments on commit d228740

Please sign in to comment.