v1

package
v1.24.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 23 Imported by: 30

Documentation

Overview

Package v1 is the v1 version of the API. +groupName=agones.dev

Index

Constants

View Source
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"
)

Block of const Error messages

View Source
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"

	// 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"

	// ProtocolTCPUDP Protocol exposes the hostPort allocated for this container for both TCP and UDP.
	ProtocolTCPUDP corev1.Protocol = "TCPUDP"

	// 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"

	// 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"
)
View Source
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"
)
View Source
const (
	// GameServerSetGameServerLabel is the label that the name of the GameServerSet
	// is set on the GameServer the GameServerSet controls
	GameServerSetGameServerLabel = agones.GroupName + "/gameserverset"
)
View Source
const VersionAnnotation = agones.GroupName + "/sdk-version"

VersionAnnotation is the key for version annotation associated with the CRD

Variables

View Source
var (
	// SchemeBuilder registers our types
	SchemeBuilder = k8sruntime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme local alias for SchemeBuilder.AddToScheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	// GameServerRolePodSelector is the selector to get all GameServer Pods
	GameServerRolePodSelector = labels.SelectorFromSet(labels.Set{RoleLabel: GameServerLabelRole})
)
View Source
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 Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

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 ValidateResource added in v1.5.0

func ValidateResource(request resource.Quantity, limit resource.Quantity, resourceName corev1.ResourceName) []error

ValidateResource validates limit or Memory CPU resources used for containers in pods If a GameServer is invalid there will be > 0 values in the returned array

Types

type AggregatedPlayerStatus added in v1.6.0

type AggregatedPlayerStatus struct {
	Count    int64 `json:"count"`
	Capacity int64 `json:"capacity"`
}

AggregatedPlayerStatus stores total player tracking values

func (*AggregatedPlayerStatus) DeepCopy added in v1.6.0

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 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

func (in *Fleet) DeepCopy() *Fleet

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Fleet.

func (*Fleet) DeepCopyInto

func (in *Fleet) DeepCopyInto(out *Fleet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Fleet) DeepCopyObject

func (in *Fleet) DeepCopyObject() runtime.Object

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

func (f *Fleet) LowerBoundReplicas(i int32) int32

LowerBoundReplicas returns 0 (the minimum value for replicas) if i is < 0

func (*Fleet) UpperBoundReplicas

func (f *Fleet) UpperBoundReplicas(i int32) int32

UpperBoundReplicas returns whichever is smaller, the value i, or the f.Spec.Replicas.

func (*Fleet) Validate

func (f *Fleet) Validate() ([]metav1.StatusCause, bool)

Validate validates the Fleet configuration. If a Fleet is invalid there will be > 0 values in the returned array

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

func (in *FleetList) DeepCopy() *FleetList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetList.

func (*FleetList) DeepCopyInto

func (in *FleetList) DeepCopyInto(out *FleetList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FleetList) DeepCopyObject

func (in *FleetList) DeepCopyObject() runtime.Object

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"`
	// Deployment strategy
	Strategy appsv1.DeploymentStrategy `json:"strategy"`
	// Scheduling strategy. Defaults to "Packed".
	Scheduling apis.SchedulingStrategy `json:"scheduling"`
	// Template the GameServer template to apply for this Fleet
	Template GameServerTemplateSpec `json:"template"`
}

FleetSpec is the spec for a Fleet

func (*FleetSpec) DeepCopy

func (in *FleetSpec) DeepCopy() *FleetSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetSpec.

func (*FleetSpec) DeepCopyInto

func (in *FleetSpec) DeepCopyInto(out *FleetSpec)

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"`
}

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) 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) 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

func (gs *GameServer) Pod(sidecars ...corev1.Container) (*corev1.Pod, error)

Pod creates a new Pod from the PodTemplateSpec attached to the GameServer resource

func (*GameServer) Validate

func (gs *GameServer) Validate() ([]metav1.StatusCause, bool)

Validate validates the GameServer configuration. If a GameServer is invalid there will be > 0 values in the returned array

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

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() ([]metav1.StatusCause, bool)

Validate validates when Create occurs. Check the name size

func (*GameServerSet) ValidateUpdate

func (gsSet *GameServerSet) ValidateUpdate(newGSS *GameServerSet) ([]metav1.StatusCause, bool)

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"`
	// Scheduling strategy. Defaults to "Packed".
	Scheduling apis.SchedulingStrategy `json:"scheduling,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"`
}

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"`
}

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

func (gss *GameServerSpec) FindContainer(name string) (int, corev1.Container, error)

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(devAddress string) ([]metav1.StatusCause, bool)

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

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"`
	NodeName      string                 `json:"nodeName"`
	ReservedUntil *metav1.Time           `json:"reservedUntil"`
	// [Stage:Alpha]
	// [FeatureFlag:PlayerTracking]
	// +optional
	Players *PlayerStatus `json:"players"`
}

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

type GameServerStatusPort struct {
	Name string `json:"name,omitempty"`
	Port int32  `json:"port"`
}

GameServerStatusPort shows the port that was allocated to a GameServer.

func (*GameServerStatusPort) DeepCopy

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

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

func (in *Health) DeepCopy() *Health

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Health.

func (*Health) DeepCopyInto

func (in *Health) DeepCopyInto(out *Health)

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

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

func (in *SdkServer) DeepCopy() *SdkServer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SdkServer.

func (*SdkServer) DeepCopyInto added in v1.2.0

func (in *SdkServer) DeepCopyInto(out *SdkServer)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL