You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Managing the configuration of game servers is a common issue after game containerization. The configuration of game servers can be presented through labels or annotations in Kubernetes (k8s), and then passed down to the containers using the Downward API for business awareness. However, in scenarios like PvE games or MMORPGs, each game server has its own unique configuration. This means that each game server requires distinct labels or annotations. Generally, the keys of these labels and annotations are the same across different game servers, only the values differ. We need a way to manage the different labels and annotations of different game servers in a batch, automatic, and persistent manner. Therefore, I propose a new custom resource definition (CRD) object called GameServerConfig.
Design
API
type GameServerConfigSpec struct {
GameServerSetName string `json:"gameServerSetName"`
LabelConfigs []StringMapConfig `json:"labelConfigs,omitempty"`
AnnotationConfigs []StringMapConfig `json:"annotationConfigs,omitempty"`
}
type StringMapConfig struct {
Type StringMapConfigType `json:"type"`
KeyName string `json:"keyName"`
IdValues []IdValue `json:"idValues,omitempty"`
RenderRule string `json:"renderRule,omitempty"`
}
type StringMapConfigType string
const (
SpecifyID StringMapConfigType = "SpecifyID"
RenderID StringMapConfigType = "RenderID"
)
type IdValue struct {
IdList []int `json:"idList,omitempty"`
Value string `json:"value,omitempty"`
}
type GameServerConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec GameServerConfigSpec `json:"spec,omitempty"`
Status GameServerConfigStatus `json:"status,omitempty"`
}
type GameServerConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []GameServer `json:"items"`
}
type GameServerConfigState string
const (
Pending GameServerConfigState = "Pending"
Succeed GameServerConfigState = "Succeed"
)
type GameServerConfigStatus struct {
State GameServerConfigState `json:"state,omitempty"`
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}
Example
There are 8 GameServers managed by GameServerSet minecraft. If a GameServerConfig as follow is applied:
Background
Managing the configuration of game servers is a common issue after game containerization. The configuration of game servers can be presented through labels or annotations in Kubernetes (k8s), and then passed down to the containers using the Downward API for business awareness. However, in scenarios like PvE games or MMORPGs, each game server has its own unique configuration. This means that each game server requires distinct labels or annotations. Generally, the keys of these labels and annotations are the same across different game servers, only the values differ. We need a way to manage the different labels and annotations of different game servers in a batch, automatic, and persistent manner. Therefore, I propose a new custom resource definition (CRD) object called GameServerConfig.
Design
API
Example
There are 8 GameServers managed by GameServerSet minecraft. If a GameServerConfig as follow is applied:
The GameServers' labels & annotations will be:
The text was updated successfully, but these errors were encountered: