Documentation ¶
Overview ¶
Package v1 is the v1 version of the API. +groupName=agones.dev
Index ¶
- Constants
- Variables
- func GetReadyReplicaCountForGameServerSets(gss []*GameServerSet) int32
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- func SumGameServerSets(list []*GameServerSet, f func(gsSet *GameServerSet) int32) int32
- func SumSpecReplicas(list []*GameServerSet) int32
- func SumStatusAllocatedReplicas(list []*GameServerSet) int32
- func SumStatusReplicas(list []*GameServerSet) int32
- func ValidateNonnegativeQuantity(value resource.Quantity, fldPath *field.Path) field.ErrorList
- func ValidateResourceRequirements(requirements *corev1.ResourceRequirements, fldPath *field.Path) field.ErrorList
- type APIHooks
- type AggregatedCounterStatus
- type AggregatedListStatus
- type AggregatedPlayerStatus
- type AllocationOverflow
- func (ao *AllocationOverflow) Apply(gs *GameServer)
- func (ao *AllocationOverflow) CountMatches(list []*GameServer) (int32, []*GameServer)
- func (in *AllocationOverflow) DeepCopy() *AllocationOverflow
- func (in *AllocationOverflow) DeepCopyInto(out *AllocationOverflow)
- func (ao *AllocationOverflow) Validate(fldPath *field.Path) field.ErrorList
- type CounterStatus
- type Eviction
- type EvictionSafe
- type Fleet
- func (f *Fleet) ApplyDefaults()
- func (in *Fleet) DeepCopy() *Fleet
- func (in *Fleet) DeepCopyInto(out *Fleet)
- func (in *Fleet) DeepCopyObject() runtime.Object
- func (f *Fleet) GameServerSet() *GameServerSet
- func (f *Fleet) GetGameServerSpec() *GameServerSpec
- func (f *Fleet) LowerBoundReplicas(i int32) int32
- func (f *Fleet) UpperBoundReplicas(i int32) int32
- func (f *Fleet) Validate(apiHooks APIHooks) field.ErrorList
- type FleetList
- type FleetSpec
- type FleetStatus
- type GameServer
- func (gs *GameServer) AppendListValues(name string, values []string) error
- func (gs *GameServer) ApplyDefaults()
- func (gs *GameServer) ApplyToPodContainer(pod *corev1.Pod, containerName string, ...) error
- func (gs *GameServer) CountPorts(f func(policy PortPolicy) bool) int
- func (in *GameServer) DeepCopy() *GameServer
- func (in *GameServer) DeepCopyInto(out *GameServer)
- func (in *GameServer) DeepCopyObject() runtime.Object
- func (gs *GameServer) DisableServiceAccount(pod *corev1.Pod) error
- func (gs *GameServer) FindGameServerContainer() (int, corev1.Container, error)
- func (gs *GameServer) GetDevAddress() (string, bool)
- func (gs *GameServer) HasPortPolicy(policy PortPolicy) bool
- func (gs *GameServer) IsActive() bool
- func (gs *GameServer) IsBeforeReady() bool
- func (gs *GameServer) IsBeingDeleted() bool
- func (gs *GameServer) IsDeletable() bool
- func (gs *GameServer) Patch(delta *GameServer) ([]byte, error)
- func (gs *GameServer) Pod(apiHooks APIHooks, sidecars ...corev1.Container) (*corev1.Pod, error)
- func (gs *GameServer) UpdateCount(name string, action string, amount int64) error
- func (gs *GameServer) UpdateCounterCapacity(name string, capacity int64) error
- func (gs *GameServer) UpdateListCapacity(name string, capacity int64) error
- func (gs *GameServer) Validate(apiHooks APIHooks) field.ErrorList
- type GameServerList
- type GameServerPort
- type GameServerSet
- func (in *GameServerSet) DeepCopy() *GameServerSet
- func (in *GameServerSet) DeepCopyInto(out *GameServerSet)
- func (in *GameServerSet) DeepCopyObject() runtime.Object
- func (gsSet *GameServerSet) GameServer() *GameServer
- func (gsSet *GameServerSet) GetGameServerSpec() *GameServerSpec
- func (gsSet *GameServerSet) Validate(apiHooks APIHooks) field.ErrorList
- func (gsSet *GameServerSet) ValidateUpdate(newGSS *GameServerSet) field.ErrorList
- type GameServerSetList
- type GameServerSetSpec
- type GameServerSetStatus
- type GameServerSpec
- func (gss *GameServerSpec) ApplyDefaults()
- func (in *GameServerSpec) DeepCopy() *GameServerSpec
- func (in *GameServerSpec) DeepCopyInto(out *GameServerSpec)
- func (gss *GameServerSpec) FindContainer(name string) (int, corev1.Container, error)
- func (gss *GameServerSpec) Validate(apiHooks APIHooks, devAddress string, fldPath *field.Path) field.ErrorList
- type GameServerState
- type GameServerStatus
- type GameServerStatusPort
- type GameServerTemplateSpec
- type Health
- type ListStatus
- type PlayerStatus
- type PlayersSpec
- type PortPolicy
- type Priority
- type SdkServer
- type SdkServerLogLevel
Constants ¶
const ( ErrContainerRequired = "Container is required when using multiple containers in the pod template" ErrHostPort = "HostPort cannot be specified with a Dynamic or Passthrough PortPolicy" ErrPortPolicyStatic = "PortPolicy must be Static" ErrContainerPortRequired = "ContainerPort must be defined for Dynamic and Static PortPolicies" ErrContainerPortPassthrough = "ContainerPort cannot be specified with Passthrough PortPolicy" ErrContainerNameInvalid = "Container must be empty or the name of a container in the pod template" // GameServerPriorityIncrement is a Counter Action that indiciates the Counter's Count should be incremented at Allocation. GameServerPriorityIncrement string = "Increment" // GameServerPriorityDecrement is a Counter Action that indiciates the Counter's Count should be decremented at Allocation. GameServerPriorityDecrement string = "Decrement" // GameServerPriorityCounter is a Type for sorting Game Servers by Counter GameServerPriorityCounter string = "Counter" // GameServerPriorityList is a Type for sorting Game Servers by List GameServerPriorityList string = "List" // GameServerPriorityAscending is a Priority Order where the smaller count is preferred in sorting. GameServerPriorityAscending string = "Ascending" // GameServerPriorityDescending is a Priority Order where the larger count is preferred in sorting. GameServerPriorityDescending string = "Descending" )
Block of const Error messages and GameServerAllocation Counter actions
const ( // ProtocolTCPUDP Protocol exposes the hostPort allocated for this container for both TCP and UDP. ProtocolTCPUDP corev1.Protocol = "TCPUDP" // RoleLabel is the label in which the Agones role is specified. // Pods from a GameServer will have the value "gameserver" RoleLabel = agones.GroupName + "/role" // GameServerLabelRole is the GameServer label value for RoleLabel GameServerLabelRole = "gameserver" // GameServerPodLabel is the label that the name of the GameServer // is set on the Pod the GameServer controls GameServerPodLabel = agones.GroupName + "/gameserver" // GameServerContainerAnnotation is the annotation that stores // which container is the container that runs the dedicated game server GameServerContainerAnnotation = agones.GroupName + "/container" // DevAddressAnnotation is an annotation to indicate that a GameServer hosted outside of Agones. // A locally hosted GameServer is not managed by Agones it is just simply registered. DevAddressAnnotation = "agones.dev/dev-address" // GameServerReadyContainerIDAnnotation is an annotation that is set on the GameServer // becomes ready, so we can track when restarts should occur and when a GameServer // should be moved to Unhealthy. GameServerReadyContainerIDAnnotation = agones.GroupName + "/ready-container-id" // PodSafeToEvictAnnotation is an annotation that the Kubernetes cluster autoscaler uses to // determine if a pod can safely be evicted to compact a cluster by moving pods between nodes // and scaling down nodes. PodSafeToEvictAnnotation = "cluster-autoscaler.kubernetes.io/safe-to-evict" // SafeToEvictLabel is a label that, when "false", matches the restrictive PDB agones-gameserver-safe-to-evict-false. SafeToEvictLabel = agones.GroupName + "/safe-to-evict" // True is the string "true" to appease the goconst lint. True = "true" // False is the string "false" to appease the goconst lint. False = "false" )
const ( // FleetNameLabel is the label that the name of the Fleet // is set to on GameServerSet and GameServer the Fleet controls FleetNameLabel = agones.GroupName + "/fleet" )
const ( // GameServerSetGameServerLabel is the label that the name of the GameServerSet // is set on the GameServer the GameServerSet controls GameServerSetGameServerLabel = agones.GroupName + "/gameserverset" )
const VersionAnnotation = agones.GroupName + "/sdk-version"
VersionAnnotation is the key for version annotation associated with the CRD
Variables ¶
var ( // GameServerRolePodSelector is the selector to get all GameServer Pods GameServerRolePodSelector = labels.SelectorFromSet(labels.Set{RoleLabel: GameServerLabelRole}) // TerminalGameServerStates is a set (map[GameServerState]bool) of states from which a GameServer will not recover. // From state diagram at https://agones.dev/site/docs/reference/gameserver/ TerminalGameServerStates = map[GameServerState]bool{ GameServerStateShutdown: true, GameServerStateError: true, GameServerStateUnhealthy: true, } )
var ( // SchemeBuilder registers our types SchemeBuilder = k8sruntime.NewSchemeBuilder(addKnownTypes) // AddToScheme local alias for SchemeBuilder.AddToScheme AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: agones.GroupName, Version: "v1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func GetReadyReplicaCountForGameServerSets ¶ added in v1.9.0
func GetReadyReplicaCountForGameServerSets(gss []*GameServerSet) int32
GetReadyReplicaCountForGameServerSets returns the total number of Status.ReadyReplicas in the list of GameServerSets
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
func SumGameServerSets ¶ added in v1.34.0
func SumGameServerSets(list []*GameServerSet, f func(gsSet *GameServerSet) int32) int32
SumGameServerSets calculates a total from the value returned from the passed in function. Useful for calculating totals based on status value(s), such as gsSet.Status.Replicas This should eventually replace the variety of `Sum*` and `GetReadyReplicaCountForGameServerSets` functions as this is a higher and more flexible abstraction.
func SumSpecReplicas ¶ added in v1.9.0
func SumSpecReplicas(list []*GameServerSet) int32
SumSpecReplicas returns the total number of Spec.Replicas in the list of GameServerSets
func SumStatusAllocatedReplicas ¶
func SumStatusAllocatedReplicas(list []*GameServerSet) int32
SumStatusAllocatedReplicas returns the total number of Status.AllocatedReplicas in the list of GameServerSets
func SumStatusReplicas ¶
func SumStatusReplicas(list []*GameServerSet) int32
SumStatusReplicas returns the total number of Status.Replicas in the list of GameServerSets
func ValidateNonnegativeQuantity ¶ added in v1.34.0
ValidateNonnegativeQuantity Validates that a Quantity is not negative
func ValidateResourceRequirements ¶ added in v1.34.0
func ValidateResourceRequirements(requirements *corev1.ResourceRequirements, fldPath *field.Path) field.ErrorList
ValidateResourceRequirements Validates resource requirement spec.
Types ¶
type APIHooks ¶ added in v1.29.0
type APIHooks interface { // ValidateGameServerSpec is called by GameServer.Validate to allow for product specific validation. ValidateGameServerSpec(*GameServerSpec, *field.Path) field.ErrorList // ValidateScheduling is called by Fleet and GameServerSet Validate() to allow for product specific validation of scheduling strategy. ValidateScheduling(apis.SchedulingStrategy, *field.Path) field.ErrorList // MutateGameServerPod is called by createGameServerPod to allow for product specific pod mutation. MutateGameServerPod(*GameServerSpec, *corev1.Pod) error // SetEviction is called by gs.Pod to enforce GameServer.Status.Eviction. SetEviction(*Eviction, *corev1.Pod) error }
APIHooks is a subset of the cloudproduct.CloudProduct interface for cloud product hooks specific to this package.
type AggregatedCounterStatus ¶ added in v1.33.0
type AggregatedCounterStatus struct { AllocatedCount int64 `json:"allocatedCount"` AllocatedCapacity int64 `json:"allocatedCapacity"` Count int64 `json:"count"` Capacity int64 `json:"capacity"` }
AggregatedCounterStatus stores total and allocated Counter tracking values
func (*AggregatedCounterStatus) DeepCopy ¶ added in v1.33.0
func (in *AggregatedCounterStatus) DeepCopy() *AggregatedCounterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregatedCounterStatus.
func (*AggregatedCounterStatus) DeepCopyInto ¶ added in v1.33.0
func (in *AggregatedCounterStatus) DeepCopyInto(out *AggregatedCounterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AggregatedListStatus ¶ added in v1.33.0
type AggregatedListStatus struct { AllocatedCount int64 `json:"allocatedCount"` AllocatedCapacity int64 `json:"allocatedCapacity"` Count int64 `json:"count"` Capacity int64 `json:"capacity"` }
AggregatedListStatus stores total and allocated List tracking values
func (*AggregatedListStatus) DeepCopy ¶ added in v1.33.0
func (in *AggregatedListStatus) DeepCopy() *AggregatedListStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregatedListStatus.
func (*AggregatedListStatus) DeepCopyInto ¶ added in v1.33.0
func (in *AggregatedListStatus) DeepCopyInto(out *AggregatedListStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AggregatedPlayerStatus ¶ added in v1.6.0
AggregatedPlayerStatus stores total player tracking values
func (*AggregatedPlayerStatus) DeepCopy ¶ added in v1.6.0
func (in *AggregatedPlayerStatus) DeepCopy() *AggregatedPlayerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AggregatedPlayerStatus.
func (*AggregatedPlayerStatus) DeepCopyInto ¶ added in v1.6.0
func (in *AggregatedPlayerStatus) DeepCopyInto(out *AggregatedPlayerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AllocationOverflow ¶ added in v1.30.0
type AllocationOverflow struct { // Labels to be applied to the `GameServer` // +optional Labels map[string]string `json:"labels,omitempty"` // Annotations to be applied to the `GameServer` // +optional Annotations map[string]string `json:"annotations,omitempty"` }
AllocationOverflow specifies what labels and/or annotations to apply on Allocated GameServers if the desired number of the underlying `GameServerSet` drops below the number of Allocated GameServers attached to it.
func (*AllocationOverflow) Apply ¶ added in v1.30.0
func (ao *AllocationOverflow) Apply(gs *GameServer)
Apply applies the labels and annotations to the passed in GameServer
func (*AllocationOverflow) CountMatches ¶ added in v1.30.0
func (ao *AllocationOverflow) CountMatches(list []*GameServer) (int32, []*GameServer)
CountMatches returns the number of Allocated GameServers that match the labels and annotations, and the set of GameServers left over.
func (*AllocationOverflow) DeepCopy ¶ added in v1.30.0
func (in *AllocationOverflow) DeepCopy() *AllocationOverflow
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllocationOverflow.
func (*AllocationOverflow) DeepCopyInto ¶ added in v1.30.0
func (in *AllocationOverflow) DeepCopyInto(out *AllocationOverflow)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CounterStatus ¶ added in v1.30.0
CounterStatus stores the current counter values
func (*CounterStatus) DeepCopy ¶ added in v1.30.0
func (in *CounterStatus) DeepCopy() *CounterStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CounterStatus.
func (*CounterStatus) DeepCopyInto ¶ added in v1.30.0
func (in *CounterStatus) DeepCopyInto(out *CounterStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Eviction ¶ added in v1.29.0
type Eviction struct { // Game server supports termination via SIGTERM: // - Always: Allow eviction for both Cluster Autoscaler and node drain for upgrades // - OnUpgrade: Allow eviction for upgrades alone // - Never (default): Pod should run to completion Safe EvictionSafe `json:"safe,omitempty"` }
Eviction specifies the eviction tolerance of the GameServer
func (*Eviction) DeepCopy ¶ added in v1.29.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Eviction.
func (*Eviction) DeepCopyInto ¶ added in v1.29.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EvictionSafe ¶ added in v1.29.0
type EvictionSafe string
EvictionSafe specified whether the game server supports termination via SIGTERM
const ( // EvictionSafeAlways means the game server supports termination via SIGTERM, and wants eviction signals // from Cluster Autoscaler scaledown and node upgrades. EvictionSafeAlways EvictionSafe = "Always" // EvictionSafeOnUpgrade means the game server supports termination via SIGTERM, and wants eviction signals // from node upgrades, but not Cluster Autoscaler scaledown. EvictionSafeOnUpgrade EvictionSafe = "OnUpgrade" // EvictionSafeNever means the game server should run to completion and may not understand SIGTERM. Eviction // from ClusterAutoscaler and upgrades should both be blocked. EvictionSafeNever EvictionSafe = "Never" )
type Fleet ¶
type Fleet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec FleetSpec `json:"spec"` Status FleetStatus `json:"status"` }
Fleet is the data structure for a Fleet resource
func (*Fleet) ApplyDefaults ¶
func (f *Fleet) ApplyDefaults()
ApplyDefaults applies default values to the Fleet
func (*Fleet) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Fleet.
func (*Fleet) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Fleet) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Fleet) GameServerSet ¶
func (f *Fleet) GameServerSet() *GameServerSet
GameServerSet returns a single GameServerSet for this Fleet definition
func (*Fleet) GetGameServerSpec ¶
func (f *Fleet) GetGameServerSpec() *GameServerSpec
GetGameServerSpec get underlying Gameserver specification
func (*Fleet) LowerBoundReplicas ¶
LowerBoundReplicas returns 0 (the minimum value for replicas) if i is < 0
func (*Fleet) UpperBoundReplicas ¶
UpperBoundReplicas returns whichever is smaller, the value i, or the f.Spec.Replicas.
type FleetList ¶
type FleetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Fleet `json:"items"` }
FleetList is a list of Fleet resources
func (*FleetList) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetList.
func (*FleetList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*FleetList) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type FleetSpec ¶
type FleetSpec struct { // Replicas are the number of GameServers that should be in this set. Defaults to 0. Replicas int32 `json:"replicas"` // [Stage: Alpha] // [FeatureFlag:FleetAllocationOverflow] // Labels and/or Annotations to apply to overflowing GameServers when the number of Allocated GameServers is more // than the desired replicas on the underlying `GameServerSet` // +optional AllocationOverflow *AllocationOverflow `json:"allocationOverflow,omitempty"` // Deployment strategy Strategy appsv1.DeploymentStrategy `json:"strategy"` // Scheduling strategy. Defaults to "Packed". Scheduling apis.SchedulingStrategy `json:"scheduling"` // (Alpha, CountsAndLists feature flag) The first Priority on the array of Priorities is the most // important for sorting. The Fleetautoscaler will use the first priority for sorting GameServers // by total Capacity in the Fleet and acts as a tie-breaker after sorting the game servers by // State and Strategy. Impacts scale down logic. // +optional Priorities []Priority `json:"priorities,omitempty"` // Template the GameServer template to apply for this Fleet Template GameServerTemplateSpec `json:"template"` }
FleetSpec is the spec for a Fleet
func (*FleetSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetSpec.
func (*FleetSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type FleetStatus ¶
type FleetStatus struct { // Replicas the total number of current GameServer replicas Replicas int32 `json:"replicas"` // ReadyReplicas are the number of Ready GameServer replicas ReadyReplicas int32 `json:"readyReplicas"` // ReservedReplicas are the total number of Reserved GameServer replicas in this fleet. // Reserved instances won't be deleted on scale down, but won't cause an autoscaler to scale up. ReservedReplicas int32 `json:"reservedReplicas"` // AllocatedReplicas are the number of Allocated GameServer replicas AllocatedReplicas int32 `json:"allocatedReplicas"` // [Stage:Alpha] // [FeatureFlag:PlayerTracking] // Players are the current total player capacity and count for this Fleet // +optional Players *AggregatedPlayerStatus `json:"players,omitempty"` // (Alpha, CountsAndLists feature flag) Counters provides aggregated Counter capacity and Counter // count for this Fleet. // +optional Counters map[string]AggregatedCounterStatus `json:"counters,omitempty"` // (Alpha, CountsAndLists feature flag) Lists provides aggregated List capacityv and List values // for this Fleet. // +optional Lists map[string]AggregatedListStatus `json:"lists,omitempty"` }
FleetStatus is the status of a Fleet
func (*FleetStatus) DeepCopy ¶
func (in *FleetStatus) DeepCopy() *FleetStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetStatus.
func (*FleetStatus) DeepCopyInto ¶
func (in *FleetStatus) DeepCopyInto(out *FleetStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GameServer ¶
type GameServer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec GameServerSpec `json:"spec"` Status GameServerStatus `json:"status"` }
GameServer is the data structure for a GameServer resource. It is worth noting that while there is a `GameServerStatus` Status entry for the `GameServer`, it is not defined as a subresource - unlike `Fleet` and other Agones resources. This is so that we can retain the ability to change multiple aspects of a `GameServer` in a single atomic operation, which is particularly useful for operations such as allocation.
func (*GameServer) AppendListValues ¶ added in v1.32.0
func (gs *GameServer) AppendListValues(name string, values []string) error
AppendListValues adds unique values to the ListStatus Values list.
func (*GameServer) ApplyDefaults ¶
func (gs *GameServer) ApplyDefaults()
ApplyDefaults applies default values to the GameServer if they are not already populated
func (*GameServer) ApplyToPodContainer ¶ added in v1.5.0
func (gs *GameServer) ApplyToPodContainer(pod *corev1.Pod, containerName string, f func(corev1.Container) corev1.Container) error
ApplyToPodContainer applies func(v1.Container) to the specified container in the pod. Returns an error if the container is not found.
func (*GameServer) CountPorts ¶
func (gs *GameServer) CountPorts(f func(policy PortPolicy) bool) int
CountPorts returns the number of ports that match condition function
func (*GameServer) DeepCopy ¶
func (in *GameServer) DeepCopy() *GameServer
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServer.
func (*GameServer) DeepCopyInto ¶
func (in *GameServer) DeepCopyInto(out *GameServer)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GameServer) DeepCopyObject ¶
func (in *GameServer) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*GameServer) DisableServiceAccount ¶
func (gs *GameServer) DisableServiceAccount(pod *corev1.Pod) error
DisableServiceAccount disables the service account for the gameserver container
func (*GameServer) FindGameServerContainer ¶
func (gs *GameServer) FindGameServerContainer() (int, corev1.Container, error)
FindGameServerContainer returns the container that is specified in gameServer.Spec.Container. Returns the index and the value. Returns an error if not found
func (*GameServer) GetDevAddress ¶
func (gs *GameServer) GetDevAddress() (string, bool)
GetDevAddress returns the address for game server.
func (*GameServer) HasPortPolicy ¶
func (gs *GameServer) HasPortPolicy(policy PortPolicy) bool
HasPortPolicy checks if there is a port with a given PortPolicy
func (*GameServer) IsActive ¶ added in v1.33.0
func (gs *GameServer) IsActive() bool
IsActive returns true if the GameServer status is Ready, Reserved, or Allocated state.
func (*GameServer) IsBeforeReady ¶ added in v1.2.0
func (gs *GameServer) IsBeforeReady() bool
IsBeforeReady returns true if the GameServer Status has yet to move to or past the Ready state in its lifecycle, such as Allocated or Reserved, or any of the Error/Unhealthy states
func (*GameServer) IsBeingDeleted ¶
func (gs *GameServer) IsBeingDeleted() bool
IsBeingDeleted returns true if the server is in the process of being deleted.
func (*GameServer) IsDeletable ¶
func (gs *GameServer) IsDeletable() bool
IsDeletable returns false if the server is currently allocated/reserved and is not already in the process of being deleted
func (*GameServer) Patch ¶
func (gs *GameServer) Patch(delta *GameServer) ([]byte, error)
Patch creates a JSONPatch to move the current GameServer to the passed in delta GameServer
func (*GameServer) Pod ¶
Pod creates a new Pod from the PodTemplateSpec attached to the GameServer resource
func (*GameServer) UpdateCount ¶ added in v1.32.0
func (gs *GameServer) UpdateCount(name string, action string, amount int64) error
UpdateCount increments or decrements a CounterStatus on a Game Server by the given amount.
func (*GameServer) UpdateCounterCapacity ¶ added in v1.32.0
func (gs *GameServer) UpdateCounterCapacity(name string, capacity int64) error
UpdateCounterCapacity updates the CounterStatus Capacity to the given capacity.
func (*GameServer) UpdateListCapacity ¶ added in v1.32.0
func (gs *GameServer) UpdateListCapacity(name string, capacity int64) error
UpdateListCapacity updates the ListStatus Capacity to the given capacity.
type GameServerList ¶
type GameServerList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []GameServer `json:"items"` }
GameServerList is a list of GameServer resources
func (*GameServerList) DeepCopy ¶
func (in *GameServerList) DeepCopy() *GameServerList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerList.
func (*GameServerList) DeepCopyInto ¶
func (in *GameServerList) DeepCopyInto(out *GameServerList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GameServerList) DeepCopyObject ¶
func (in *GameServerList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type GameServerPort ¶
type GameServerPort struct { // Name is the descriptive name of the port Name string `json:"name,omitempty"` // PortPolicy defines the policy for how the HostPort is populated. // Dynamic port will allocate a HostPort within the selected MIN_PORT and MAX_PORT range passed to the controller // at installation time. // When `Static` portPolicy is specified, `HostPort` is required, to specify the port that game clients will // connect to PortPolicy PortPolicy `json:"portPolicy,omitempty"` // Container is the name of the container on which to open the port. Defaults to the game server container. // +optional Container *string `json:"container,omitempty"` // ContainerPort is the port that is being opened on the specified container's process ContainerPort int32 `json:"containerPort,omitempty"` // HostPort the port exposed on the host for clients to connect to HostPort int32 `json:"hostPort,omitempty"` // Protocol is the network protocol being used. Defaults to UDP. TCP and TCPUDP are other options. Protocol corev1.Protocol `json:"protocol,omitempty"` }
GameServerPort defines a set of Ports that are to be exposed via the GameServer
func (*GameServerPort) DeepCopy ¶
func (in *GameServerPort) DeepCopy() *GameServerPort
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerPort.
func (*GameServerPort) DeepCopyInto ¶
func (in *GameServerPort) DeepCopyInto(out *GameServerPort)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (GameServerPort) Status ¶
func (p GameServerPort) Status() GameServerStatusPort
Status returns a GameServerSatusPort for this GameServerPort
type GameServerSet ¶
type GameServerSet struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec GameServerSetSpec `json:"spec"` Status GameServerSetStatus `json:"status"` }
GameServerSet is the data structure for a set of GameServers. This matches philosophically with the relationship between Deployments and ReplicaSets
func (*GameServerSet) DeepCopy ¶
func (in *GameServerSet) DeepCopy() *GameServerSet
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSet.
func (*GameServerSet) DeepCopyInto ¶
func (in *GameServerSet) DeepCopyInto(out *GameServerSet)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GameServerSet) DeepCopyObject ¶
func (in *GameServerSet) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*GameServerSet) GameServer ¶
func (gsSet *GameServerSet) GameServer() *GameServer
GameServer returns a single GameServer derived from the GameServer template
func (*GameServerSet) GetGameServerSpec ¶
func (gsSet *GameServerSet) GetGameServerSpec() *GameServerSpec
GetGameServerSpec get underlying GameServer specification
func (*GameServerSet) Validate ¶
func (gsSet *GameServerSet) Validate(apiHooks APIHooks) field.ErrorList
Validate validates when Create occurs. Check the name size
func (*GameServerSet) ValidateUpdate ¶
func (gsSet *GameServerSet) ValidateUpdate(newGSS *GameServerSet) field.ErrorList
ValidateUpdate validates when updates occur. The argument is the new GameServerSet, being passed into the old GameServerSet
type GameServerSetList ¶
type GameServerSetList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []GameServerSet `json:"items"` }
GameServerSetList is a list of GameServerSet resources
func (*GameServerSetList) DeepCopy ¶
func (in *GameServerSetList) DeepCopy() *GameServerSetList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSetList.
func (*GameServerSetList) DeepCopyInto ¶
func (in *GameServerSetList) DeepCopyInto(out *GameServerSetList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GameServerSetList) DeepCopyObject ¶
func (in *GameServerSetList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type GameServerSetSpec ¶
type GameServerSetSpec struct { // Replicas are the number of GameServers that should be in this set Replicas int32 `json:"replicas"` // [Stage: Alpha] // [FeatureFlag:FleetAllocationOverflow] // Labels and Annotations to apply to GameServers when the number of Allocated GameServers drops below // the desired replicas on the underlying `GameServerSet` // +optional AllocationOverflow *AllocationOverflow `json:"allocationOverflow,omitempty"` // Scheduling strategy. Defaults to "Packed". Scheduling apis.SchedulingStrategy `json:"scheduling,omitempty"` // (Alpha, CountsAndLists feature flag) The first Priority on the array of Priorities is the most // important for sorting. The Fleetautoscaler will use the first priority for sorting GameServers // by total Capacity in the Fleet and acts as a tie-breaker after sorting the game servers by // State and Strategy. Impacts scale down logic. // +optional Priorities []Priority `json:"priorities,omitempty"` // Template the GameServer template to apply for this GameServerSet Template GameServerTemplateSpec `json:"template"` }
GameServerSetSpec the specification for GameServerSet
func (*GameServerSetSpec) DeepCopy ¶
func (in *GameServerSetSpec) DeepCopy() *GameServerSetSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSetSpec.
func (*GameServerSetSpec) DeepCopyInto ¶
func (in *GameServerSetSpec) DeepCopyInto(out *GameServerSetSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GameServerSetStatus ¶
type GameServerSetStatus struct { // Replicas is the total number of current GameServer replicas Replicas int32 `json:"replicas"` // ReadyReplicas is the number of Ready GameServer replicas ReadyReplicas int32 `json:"readyReplicas"` // ReservedReplicas is the number of Reserved GameServer replicas ReservedReplicas int32 `json:"reservedReplicas"` // AllocatedReplicas is the number of Allocated GameServer replicas AllocatedReplicas int32 `json:"allocatedReplicas"` // ShutdownReplicas is the number of Shutdown GameServers replicas ShutdownReplicas int32 `json:"shutdownReplicas"` // [Stage:Alpha] // [FeatureFlag:PlayerTracking] // Players is the current total player capacity and count for this GameServerSet // +optional Players *AggregatedPlayerStatus `json:"players,omitempty"` // (Alpha, CountsAndLists feature flag) Counters provides aggregated Counter capacity and Counter // count for this GameServerSet. // +optional Counters map[string]AggregatedCounterStatus `json:"counters,omitempty"` // (Alpha, CountsAndLists feature flag) Lists provides aggregated List capacity and List values // for this GameServerSet. // +optional Lists map[string]AggregatedListStatus `json:"lists,omitempty"` }
GameServerSetStatus is the status of a GameServerSet
func (*GameServerSetStatus) DeepCopy ¶
func (in *GameServerSetStatus) DeepCopy() *GameServerSetStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSetStatus.
func (*GameServerSetStatus) DeepCopyInto ¶
func (in *GameServerSetStatus) DeepCopyInto(out *GameServerSetStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GameServerSpec ¶
type GameServerSpec struct { // Container specifies which Pod container is the game server. Only required if there is more than one // container defined Container string `json:"container,omitempty"` // Ports are the array of ports that can be exposed via the game server Ports []GameServerPort `json:"ports,omitempty"` // Health configures health checking Health Health `json:"health,omitempty"` // Scheduling strategy. Defaults to "Packed" Scheduling apis.SchedulingStrategy `json:"scheduling,omitempty"` // SdkServer specifies parameters for the Agones SDK Server sidecar container SdkServer SdkServer `json:"sdkServer,omitempty"` // Template describes the Pod that will be created for the GameServer Template corev1.PodTemplateSpec `json:"template"` // (Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features. // +optional Players *PlayersSpec `json:"players,omitempty"` // (Alpha, CountsAndLists feature flag) Counters and Lists provides the configuration for generic tracking features. // +optional Counters map[string]CounterStatus `json:"counters,omitempty"` Lists map[string]ListStatus `json:"lists,omitempty"` // Eviction specifies the eviction tolerance of the GameServer. Defaults to "Never". // +optional Eviction *Eviction `json:"eviction,omitempty"` }
GameServerSpec is the spec for a GameServer resource
func (*GameServerSpec) ApplyDefaults ¶
func (gss *GameServerSpec) ApplyDefaults()
ApplyDefaults applies default values to the GameServerSpec if they are not already populated
func (*GameServerSpec) DeepCopy ¶
func (in *GameServerSpec) DeepCopy() *GameServerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerSpec.
func (*GameServerSpec) DeepCopyInto ¶
func (in *GameServerSpec) DeepCopyInto(out *GameServerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GameServerSpec) FindContainer ¶ added in v1.5.0
FindContainer returns the container specified by the name parameter. Returns the index and the value. Returns an error if not found.
func (*GameServerSpec) Validate ¶
func (gss *GameServerSpec) Validate(apiHooks APIHooks, devAddress string, fldPath *field.Path) field.ErrorList
Validate validates the GameServerSpec configuration. devAddress is a specific IP address used for local Gameservers, for fleets "" is used If a GameServer Spec is invalid there will be > 0 values in the returned array
type GameServerState ¶
type GameServerState string
GameServerState is the state for the GameServer
const ( // GameServerStatePortAllocation is for when a dynamically allocating GameServer // is being created, an open port needs to be allocated GameServerStatePortAllocation GameServerState = "PortAllocation" // GameServerStateCreating is before the Pod for the GameServer is being created GameServerStateCreating GameServerState = "Creating" // GameServerStateStarting is for when the Pods for the GameServer are being // created but are not yet Scheduled GameServerStateStarting GameServerState = "Starting" // GameServerStateScheduled is for when we have determined that the Pod has been // scheduled in the cluster -- basically, we have a NodeName GameServerStateScheduled GameServerState = "Scheduled" // GameServerStateRequestReady is when the GameServer has declared that it is ready GameServerStateRequestReady GameServerState = "RequestReady" // GameServerStateReady is when a GameServer is ready to take connections // from Game clients GameServerStateReady GameServerState = "Ready" // GameServerStateShutdown is when the GameServer has shutdown and everything needs to be // deleted from the cluster GameServerStateShutdown GameServerState = "Shutdown" // GameServerStateError is when something has gone wrong with the Gameserver and // it cannot be resolved GameServerStateError GameServerState = "Error" // GameServerStateUnhealthy is when the GameServer has failed its health checks GameServerStateUnhealthy GameServerState = "Unhealthy" // GameServerStateReserved is for when a GameServer is reserved and therefore can be allocated but not removed GameServerStateReserved GameServerState = "Reserved" // GameServerStateAllocated is when the GameServer has been allocated to a session GameServerStateAllocated GameServerState = "Allocated" )
type GameServerStatus ¶
type GameServerStatus struct { // GameServerState is the current state of a GameServer, e.g. Creating, Starting, Ready, etc State GameServerState `json:"state"` Ports []GameServerStatusPort `json:"ports"` Address string `json:"address"` // Addresses is the array of addresses at which the GameServer can be reached; copy of Node.Status.addresses. // +optional Addresses []corev1.NodeAddress `json:"addresses"` NodeName string `json:"nodeName"` ReservedUntil *metav1.Time `json:"reservedUntil"` // [Stage:Alpha] // [FeatureFlag:PlayerTracking] // +optional Players *PlayerStatus `json:"players"` // (Alpha, CountsAndLists feature flag) Counters and Lists provides the configuration for generic tracking features. // +optional Counters map[string]CounterStatus `json:"counters,omitempty"` // +optional Lists map[string]ListStatus `json:"lists,omitempty"` // Eviction specifies the eviction tolerance of the GameServer. // +optional Eviction *Eviction `json:"eviction,omitempty"` }
GameServerStatus is the status for a GameServer resource
func (*GameServerStatus) DeepCopy ¶
func (in *GameServerStatus) DeepCopy() *GameServerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerStatus.
func (*GameServerStatus) DeepCopyInto ¶
func (in *GameServerStatus) DeepCopyInto(out *GameServerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GameServerStatusPort ¶
GameServerStatusPort shows the port that was allocated to a GameServer.
func (*GameServerStatusPort) DeepCopy ¶
func (in *GameServerStatusPort) DeepCopy() *GameServerStatusPort
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerStatusPort.
func (*GameServerStatusPort) DeepCopyInto ¶
func (in *GameServerStatusPort) DeepCopyInto(out *GameServerStatusPort)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type GameServerTemplateSpec ¶
type GameServerTemplateSpec struct { metav1.ObjectMeta `json:"metadata,omitempty"` Spec GameServerSpec `json:"spec"` }
GameServerTemplateSpec is a template for GameServers
func (*GameServerTemplateSpec) DeepCopy ¶
func (in *GameServerTemplateSpec) DeepCopy() *GameServerTemplateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GameServerTemplateSpec.
func (*GameServerTemplateSpec) DeepCopyInto ¶
func (in *GameServerTemplateSpec) DeepCopyInto(out *GameServerTemplateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Health ¶
type Health struct { // Disabled is whether health checking is disabled or not Disabled bool `json:"disabled,omitempty"` // PeriodSeconds is the number of seconds each health ping has to occur in PeriodSeconds int32 `json:"periodSeconds,omitempty"` // FailureThreshold how many failures in a row constitutes unhealthy FailureThreshold int32 `json:"failureThreshold,omitempty"` // InitialDelaySeconds initial delay before checking health InitialDelaySeconds int32 `json:"initialDelaySeconds,omitempty"` }
Health configures health checking on the GameServer
func (*Health) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Health.
func (*Health) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ListStatus ¶ added in v1.30.0
ListStatus stores the current list values
func (*ListStatus) DeepCopy ¶ added in v1.30.0
func (in *ListStatus) DeepCopy() *ListStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListStatus.
func (*ListStatus) DeepCopyInto ¶ added in v1.30.0
func (in *ListStatus) DeepCopyInto(out *ListStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PlayerStatus ¶ added in v1.4.0
type PlayerStatus struct { Count int64 `json:"count"` Capacity int64 `json:"capacity"` IDs []string `json:"ids"` }
PlayerStatus stores the current player capacity values
func (*PlayerStatus) DeepCopy ¶ added in v1.4.0
func (in *PlayerStatus) DeepCopy() *PlayerStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlayerStatus.
func (*PlayerStatus) DeepCopyInto ¶ added in v1.4.0
func (in *PlayerStatus) DeepCopyInto(out *PlayerStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PlayersSpec ¶ added in v1.4.0
type PlayersSpec struct {
InitialCapacity int64 `json:"initialCapacity,omitempty"`
}
PlayersSpec tracks the initial player capacity
func (*PlayersSpec) DeepCopy ¶ added in v1.4.0
func (in *PlayersSpec) DeepCopy() *PlayersSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlayersSpec.
func (*PlayersSpec) DeepCopyInto ¶ added in v1.4.0
func (in *PlayersSpec) DeepCopyInto(out *PlayersSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PortPolicy ¶
type PortPolicy string
PortPolicy is the port policy for the GameServer
const ( // Static PortPolicy means that the user defines the hostPort to be used // in the configuration. Static PortPolicy = "Static" // Dynamic PortPolicy means that the system will choose an open // port for the GameServer in question Dynamic PortPolicy = "Dynamic" // Passthrough dynamically sets the `containerPort` to the same value as the dynamically selected hostPort. // This will mean that users will need to lookup what port has been opened through the server side SDK. Passthrough PortPolicy = "Passthrough" )
type Priority ¶ added in v1.34.0
type Priority struct { Type string `json:"type"` Key string `json:"key"` Order string `json:"order"` }
Priority is a sorting option for GameServers with Counters or Lists based on the Capacity. Type: Sort by a "Counter" or a "List". Key: The name of the Counter or List. If not found on the GameServer, has no impact. Order: Sort by "Ascending" or "Descending". "Descending" a bigger Capacity is preferred. "Ascending" would be smaller Capacity is preferred.
func (*Priority) DeepCopy ¶ added in v1.34.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Priority.
func (*Priority) DeepCopyInto ¶ added in v1.34.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SdkServer ¶ added in v1.1.0
type SdkServer struct { // LogLevel for SDK server (sidecar) logs. Defaults to "Info" LogLevel SdkServerLogLevel `json:"logLevel,omitempty"` // GRPCPort is the port on which the SDK Server binds the gRPC server to accept incoming connections GRPCPort int32 `json:"grpcPort,omitempty"` // HTTPPort is the port on which the SDK Server binds the HTTP gRPC gateway server to accept incoming connections HTTPPort int32 `json:"httpPort,omitempty"` }
SdkServer specifies parameters for the Agones SDK Server sidecar container
func (*SdkServer) DeepCopy ¶ added in v1.2.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdkServer.
func (*SdkServer) DeepCopyInto ¶ added in v1.2.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SdkServerLogLevel ¶ added in v1.1.0
type SdkServerLogLevel string
SdkServerLogLevel is the log level for SDK server (sidecar) logs
const ( // SdkServerLogLevelInfo will cause the SDK server to output all messages except for debug messages. SdkServerLogLevelInfo SdkServerLogLevel = "Info" // SdkServerLogLevelDebug will cause the SDK server to output all messages including debug messages. SdkServerLogLevelDebug SdkServerLogLevel = "Debug" // SdkServerLogLevelError will cause the SDK server to only output error messages. SdkServerLogLevelError SdkServerLogLevel = "Error" )