State & OpsState
GameServer Stateâ
State represents the runtime state of the game server, related to the lifecycle of the pod and cannot be customized by the user. The current State includes the following values:
- Creating ââ indicates that the pod is being created, equivalent to Pod Pending
- Ready ââ indicates that the pod is ready, with the pod ready condition being true
- NotReady ââ indicates that the pod is not ready, with the pod ready condition being false
- Crash ââ indicates that the pod has failed, equivalent to Pod Failed
- Deleting ââ indicates that the pod is being deleted, equivalent to Pod Terminating
- Updating ââ indicates that the pod is undergoing in-place upgrade
- PreDelete ââ indicates that the pod is in a pre-deletion state. It appears after executing the pod's deletion action with a deletion lifecycle hook set and entering the Deleting state after resolving the deadlock
- PreUpdate ââ indicates that the pod is in a pre-upgrade state. It appears after performing an in-place upgrade of the pod with an update lifecycle hook set and entering the Updating state after resolving the deadlock
- Unknown ââ all other states not mentioned above
Annotation "game.kruise.io/state-last-changed-time" records the time when the state was last changed. Users can use DownwardAPI to sink it into the container for business applications to obtain.
GameServer OpsStateâ
OpsState represents the operational state of the game server, determined by the business and can be freely modified by the user. OKG provides some reserved values with special meanings, including:
- None ââ default value, representing no exceptions or special states
- WaitToBeDeleted ââ the highest priority for game server scaling down, and will be automatically reclaimed after configuring automatic scaling policy
- Maintaining ââ the lowest priority for game server scaling down
- Allocated ââ the scaling down priority of the game server is greater than Maintaining but less than None. It usually represents that the game server has been allocated and can be used in game matching scenarios.
- Kill ââ game servers with Kill set will be directly deleted by the OKG controller
Users can change the GameServer opsState by calling the K8s API (or kubectl), and can also automatically trigger the corresponding GameServer opsState change by customizing the service quality features within the business container.
Annotation "game.kruise.io/opsState-last-changed-time" records the time when the state was last changed. Users can use DownwardAPI to sink it into the container for business applications to obtain.