update docs (#31)
* add CRD field description Signed-off-by: ChrisLiu <chrisliu1995@163.com>
This commit is contained in:
parent
4f950c2604
commit
cef830862d
|
|
@ -27,7 +27,7 @@ $ helm install kruise-game openkruise/kruise-game --version 0.2.0
|
||||||
|
|
||||||
0) 编辑Makefile,更改其中{IMG}字段,将其改为自身的仓库地址
|
0) 编辑Makefile,更改其中{IMG}字段,将其改为自身的仓库地址
|
||||||
|
|
||||||
1) 编译并打包kurise-game-manager镜像
|
1) 编译并打包kruise-game-manager镜像
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make docker-build
|
make docker-build
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,229 @@
|
||||||
|
## GameServerSet
|
||||||
|
|
||||||
|
### GameServerSetSpec
|
||||||
|
|
||||||
|
```
|
||||||
|
type GameServerSetSpec struct {
|
||||||
|
// 游戏服数目,必须指定,最小值为0
|
||||||
|
Replicas *int32 `json:"replicas"`
|
||||||
|
|
||||||
|
// 游戏服模版
|
||||||
|
GameServerTemplate GameServerTemplate `json:"gameServerTemplate,omitempty"`
|
||||||
|
|
||||||
|
// 保留的游戏服序号,可选项。若指定了该序号,已经存在的游戏服将被删除;而未存在的游戏服,新建时将跳过、不创建该序号
|
||||||
|
ReserveGameServerIds []int `json:"reserveGameServerIds,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服自定义服务质量
|
||||||
|
ServiceQualities []ServiceQuality `json:"serviceQualities,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服批量更新策略
|
||||||
|
UpdateStrategy UpdateStrategy `json:"updateStrategy,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服水平伸缩策略
|
||||||
|
ScaleStrategy ScaleStrategy `json:"scaleStrategy,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服接入层网络设置
|
||||||
|
Network *Network `json:"network,omitempty"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### GameServerSetStatus
|
||||||
|
|
||||||
|
```
|
||||||
|
type GameServerSetStatus struct {
|
||||||
|
// 控制器观察到GameServerSet的迭代版本
|
||||||
|
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服数目
|
||||||
|
Replicas int32 `json:"replicas"`
|
||||||
|
|
||||||
|
// 处于Ready的游戏服数目
|
||||||
|
ReadyReplicas int32 `json:"readyReplicas"`
|
||||||
|
|
||||||
|
// 可用的游戏服数目
|
||||||
|
AvailableReplicas int32 `json:"availableReplicas"`
|
||||||
|
|
||||||
|
// 当前的游戏服数目
|
||||||
|
CurrentReplicas int32 `json:"currentReplicas"`
|
||||||
|
|
||||||
|
// 已更新的游戏服数目
|
||||||
|
UpdatedReplicas int32 `json:"updatedReplicas"`
|
||||||
|
|
||||||
|
// 已更新并Ready的游戏服数目
|
||||||
|
UpdatedReadyReplicas int32 `json:"updatedReadyReplicas,omitempty"`
|
||||||
|
|
||||||
|
// 处于Maintaining状态的游戏服数目
|
||||||
|
MaintainingReplicas *int32 `json:"maintainingReplicas,omitempty"`
|
||||||
|
|
||||||
|
// 处于WaitToBeDeleted状态的游戏服数目
|
||||||
|
WaitToBeDeletedReplicas *int32 `json:"waitToBeDeletedReplicas,omitempty"`
|
||||||
|
|
||||||
|
// LabelSelector 是标签选择器,用于查询应与 HPA 使用的副本数相匹配的游戏服。
|
||||||
|
LabelSelector string `json:"labelSelector,omitempty"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### GameServerTemplate
|
||||||
|
|
||||||
|
```
|
||||||
|
type GameServerTemplate struct {
|
||||||
|
// 继承至PodTemplateSpec的所有字段
|
||||||
|
corev1.PodTemplateSpec `json:",inline"`
|
||||||
|
|
||||||
|
// 对持久卷的请求和声明
|
||||||
|
VolumeClaimTemplates []corev1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### UpdateStrategy
|
||||||
|
|
||||||
|
```
|
||||||
|
type UpdateStrategy struct {
|
||||||
|
// 更新策略类型,可选择 OnDelete 或 RollingUpdate
|
||||||
|
Type apps.StatefulSetUpdateStrategyType `json:"type,omitempty"`
|
||||||
|
|
||||||
|
// 当策略类型为RollingUpdate时可用,指定RollingUpdate具体策略
|
||||||
|
RollingUpdate *RollingUpdateStatefulSetStrategy `json:"rollingUpdate,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
type RollingUpdateStatefulSetStrategy struct {
|
||||||
|
// 保留旧版本游戏服的数量或百分比,默认为 0。
|
||||||
|
Partition *int32 `json:"partition,omitempty"`
|
||||||
|
|
||||||
|
|
||||||
|
// 会保证发布过程中最多有多少个游戏服处于不可用状态,默认值为 1。
|
||||||
|
// 支持设置百分比,比如:20%,意味着最多有20%个游戏服处于不可用状态。
|
||||||
|
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
|
||||||
|
|
||||||
|
// 表明游戏服更新的方式。可选择ReCreate / InPlaceIfPossible / InPlaceOnly。默认为ReCreate。
|
||||||
|
PodUpdatePolicy kruiseV1beta1.PodUpdateStrategyType `json:"podUpdatePolicy,omitempty"`
|
||||||
|
|
||||||
|
// 是否暂停发布,默认为false。
|
||||||
|
Paused bool `json:"paused,omitempty"`
|
||||||
|
|
||||||
|
// 原地升级的策略
|
||||||
|
InPlaceUpdateStrategy *appspub.InPlaceUpdateStrategy `json:"inPlaceUpdateStrategy,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服在更新后多久被视为准备就绪,默认为0,最大值为300。
|
||||||
|
MinReadySeconds *int32 `json:"minReadySeconds,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type InPlaceUpdateStrategy struct {
|
||||||
|
// 将游戏服状态设置为NotReady和更新游戏服Spec中的镜像之间的时间跨度。
|
||||||
|
GracePeriodSeconds int32 `json:"gracePeriodSeconds,omitempty"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### ScaleStrategy
|
||||||
|
|
||||||
|
```
|
||||||
|
type ScaleStrategy struct {
|
||||||
|
// 扩缩期间游戏服最大不可用的数量,可为绝对值或百分比
|
||||||
|
MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### ServiceQualities
|
||||||
|
|
||||||
|
```
|
||||||
|
type ServiceQuality struct {
|
||||||
|
// 继承至corev1.Probe所有字段,此处指定探测方式
|
||||||
|
corev1.Probe `json:",inline"`
|
||||||
|
|
||||||
|
// 自定义服务质量的名称,区别定义不同的服务质量
|
||||||
|
Name string `json:"name"`
|
||||||
|
|
||||||
|
// 探测的容器名称
|
||||||
|
ContainerName string `json:"containerName,omitempty"`
|
||||||
|
|
||||||
|
// 是否让GameServerSpec在ServiceQualityAction执行后不发生变化。
|
||||||
|
// 当Permanent为true时,无论检测结果如何,ServiceQualityAction只会执行一次。
|
||||||
|
// 当Permanent为false时,即使ServiceQualityAction已经执行过,也可以再次执行ServiceQualityAction。
|
||||||
|
Permanent bool `json:"permanent"`
|
||||||
|
|
||||||
|
// 服务质量对应执行动作
|
||||||
|
ServiceQualityAction []ServiceQualityAction `json:"serviceQualityAction,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ServiceQualityAction struct {
|
||||||
|
// 用户设定当探测结果为true/false时执行动作
|
||||||
|
State bool `json:"state"`
|
||||||
|
|
||||||
|
// 动作为更改GameServerSpec中的字段
|
||||||
|
GameServerSpec `json:",inline"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Network
|
||||||
|
|
||||||
|
```
|
||||||
|
type Network struct {
|
||||||
|
// 网络类型
|
||||||
|
NetworkType string `json:"networkType,omitempty"`
|
||||||
|
|
||||||
|
// 网络参数,不同网络类型需要填写不同的网络参数
|
||||||
|
NetworkConf []NetworkConfParams `json:"networkConf,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type NetworkConfParams KVParams
|
||||||
|
|
||||||
|
type KVParams struct {
|
||||||
|
// 参数名,名称由网络插件决定
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
|
||||||
|
// 参数值,格式由网络插件决定
|
||||||
|
Value string `json:"value,omitempty"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## GameServer
|
||||||
|
|
||||||
|
### GameServerSpec
|
||||||
|
|
||||||
|
```
|
||||||
|
type GameServerSpec struct {
|
||||||
|
// 游戏服运维状态,表示业务相关的游戏服状态,目前可指定的状态有:None / WaitToBeDeleted / Maintaining。默认为None
|
||||||
|
OpsState OpsState `json:"opsState,omitempty"`
|
||||||
|
|
||||||
|
// 更新优先级,优先级高则优先被更新
|
||||||
|
UpdatePriority *intstr.IntOrString `json:"updatePriority,omitempty"`
|
||||||
|
|
||||||
|
// 删除优先级,优先级高则优先被删除
|
||||||
|
DeletionPriority *intstr.IntOrString `json:"deletionPriority,omitempty"`
|
||||||
|
|
||||||
|
// 是否进行网络隔离、切断接入层网络,默认为false
|
||||||
|
NetworkDisabled bool `json:"networkDisabled,omitempty"`
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### GameServerStatus
|
||||||
|
|
||||||
|
```
|
||||||
|
type GameServerStatus struct {
|
||||||
|
// 期望游戏服状态,Ready
|
||||||
|
DesiredState GameServerState `json:"desiredState,omitempty"`
|
||||||
|
|
||||||
|
// 当前游戏服实际状态
|
||||||
|
CurrentState GameServerState `json:"currentState,omitempty"`
|
||||||
|
|
||||||
|
// 网络状态信息
|
||||||
|
NetworkStatus NetworkStatus `json:"networkStatus,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服对应pod状态
|
||||||
|
PodStatus corev1.PodStatus `json:"podStatus,omitempty"`
|
||||||
|
|
||||||
|
// 游戏服服务质量状况
|
||||||
|
ServiceQualitiesCondition []ServiceQualityCondition `json:"serviceQualitiesConditions,omitempty"`
|
||||||
|
|
||||||
|
// 当前更新优先级
|
||||||
|
UpdatePriority *intstr.IntOrString `json:"updatePriority,omitempty"`
|
||||||
|
|
||||||
|
// 当前删除优先级
|
||||||
|
DeletionPriority *intstr.IntOrString `json:"deletionPriority,omitempty"`
|
||||||
|
|
||||||
|
// 上次变更时间
|
||||||
|
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||||
|
}
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue