v1

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder registers our types
	SchemeBuilder = k8sruntime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme local alias for SchemeBuilder.AddToScheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: allocation.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

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

Types

type GameServerAllocation

type GameServerAllocation struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              GameServerAllocationSpec   `json:"spec"`
	Status            GameServerAllocationStatus `json:"status,omitempty"`
}

GameServerAllocation is the data structure for allocating against a set of GameServers, defined `selectors` selectors

func (*GameServerAllocation) ApplyDefaults

func (gsa *GameServerAllocation) ApplyDefaults()

ApplyDefaults applies the default values to this GameServerAllocation

func (*GameServerAllocation) Converter added in v1.17.0

func (gsa *GameServerAllocation) Converter()

Converter converts game server allocation required and preferred fields to selectors field.

func (*GameServerAllocation) DeepCopy

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

func (*GameServerAllocation) DeepCopyInto

func (in *GameServerAllocation) DeepCopyInto(out *GameServerAllocation)

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

func (*GameServerAllocation) DeepCopyObject

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

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GameServerAllocation) Validate

func (gsa *GameServerAllocation) Validate() ([]metav1.StatusCause, bool)

Validate validation for the GameServerAllocation Validate should be called before attempting to Match any of the GameServer selectors.

type GameServerAllocationList

type GameServerAllocationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []GameServerAllocation `json:"items"`
}

GameServerAllocationList is a list of GameServer Allocation resources

func (*GameServerAllocationList) DeepCopy

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

func (*GameServerAllocationList) DeepCopyInto

func (in *GameServerAllocationList) DeepCopyInto(out *GameServerAllocationList)

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

func (*GameServerAllocationList) DeepCopyObject

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

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type GameServerAllocationSpec

type GameServerAllocationSpec struct {
	// MultiClusterPolicySelector if specified, multi-cluster policies are applied.
	// Otherwise, allocation will happen locally.
	MultiClusterSetting MultiClusterSetting `json:"multiClusterSetting,omitempty"`

	// Deprecated: use field Selectors instead. If Selectors is set, this field is ignored.
	// Required is the GameServer selector from which to choose GameServers from.
	// Defaults to all GameServers.
	Required GameServerSelector `json:"required,omitempty"`

	// Deprecated: use field Selectors instead. If Selectors is set, this field is ignored.
	// Preferred is an ordered list of preferred GameServer selectors
	// that are optional to be fulfilled, but will be searched before the `required` selector.
	// If the first selector is not matched, the selection attempts the second selector, and so on.
	// If any of the preferred selectors are matched, the required selector is not considered.
	// This is useful for things like smoke testing of new game servers.
	Preferred []GameServerSelector `json:"preferred,omitempty"`

	// Ordered list of GameServer label selectors.
	// If the first selector is not matched, the selection attempts the second selector, and so on.
	// This is useful for things like smoke testing of new game servers.
	// Note: This field can only be set if neither Required or Preferred is set.
	Selectors []GameServerSelector `json:"selectors,omitempty"`

	// Scheduling strategy. Defaults to "Packed".
	Scheduling apis.SchedulingStrategy `json:"scheduling"`

	// MetaPatch is optional custom metadata that is added to the game server at allocation
	// You can use this to tell the server necessary session data
	MetaPatch MetaPatch `json:"metadata,omitempty"`
}

GameServerAllocationSpec is the spec for a GameServerAllocation

func (*GameServerAllocationSpec) DeepCopy

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

func (*GameServerAllocationSpec) DeepCopyInto

func (in *GameServerAllocationSpec) DeepCopyInto(out *GameServerAllocationSpec)

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

type GameServerAllocationState

type GameServerAllocationState string

GameServerAllocationState is the Allocation state

const (
	// GameServerAllocationAllocated is allocation successful
	GameServerAllocationAllocated GameServerAllocationState = "Allocated"
	// GameServerAllocationUnAllocated when the allocation is unsuccessful
	GameServerAllocationUnAllocated GameServerAllocationState = "UnAllocated"
	// GameServerAllocationContention when the allocation is unsuccessful
	// because of contention
	GameServerAllocationContention GameServerAllocationState = "Contention"
)

type GameServerAllocationStatus

type GameServerAllocationStatus struct {
	// GameServerState is the current state of an GameServerAllocation, e.g. Allocated, or UnAllocated
	State          GameServerAllocationState       `json:"state"`
	GameServerName string                          `json:"gameServerName"`
	Ports          []agonesv1.GameServerStatusPort `json:"ports,omitempty"`
	Address        string                          `json:"address,omitempty"`
	NodeName       string                          `json:"nodeName,omitempty"`
	// If the allocation is from a remote cluster, Source is the endpoint of the remote agones-allocator.
	// Otherwise, Source is "local"
	Source string `json:"source"`
}

GameServerAllocationStatus is the status for an GameServerAllocation resource

func (*GameServerAllocationStatus) DeepCopy

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

func (*GameServerAllocationStatus) DeepCopyInto

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

type GameServerSelector added in v1.17.0

type GameServerSelector struct {
	// See: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
	metav1.LabelSelector `json:",inline"`
	// [Stage:Beta]
	// [FeatureFlag:StateAllocationFilter]
	// +optional
	// GameServerState specifies which State is the filter to be used when attempting to retrieve a GameServer
	// via Allocation. Defaults to "Ready". The only other option is "Allocated", which can be used in conjunction with
	// label/annotation/player selectors to retrieve an already Allocated GameServer.
	GameServerState *agonesv1.GameServerState `json:"gameServerState,omitempty"`
	// [Stage:Alpha]
	// [FeatureFlag:PlayerAllocationFilter]
	// +optional
	// Players provides a filter on minimum and maximum values for player capacity when retrieving a GameServer
	// through Allocation. Defaults to no limits.
	Players *PlayerSelector `json:"players,omitempty"`
}

GameServerSelector contains all the filter options for selecting a GameServer for allocation.

func (*GameServerSelector) ApplyDefaults added in v1.17.0

func (s *GameServerSelector) ApplyDefaults()

ApplyDefaults applies default values to the PlayerSelector

func (*GameServerSelector) DeepCopy added in v1.17.0

func (in *GameServerSelector) DeepCopy() *GameServerSelector

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

func (*GameServerSelector) DeepCopyInto added in v1.17.0

func (in *GameServerSelector) DeepCopyInto(out *GameServerSelector)

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

func (*GameServerSelector) Matches added in v1.17.0

func (s *GameServerSelector) Matches(gs *agonesv1.GameServer) bool

Matches checks to see if a GameServer matches a given GameServerSelector's criteria. Will panic if the `GameServerSelector` has not passed `Validate()`.

func (*GameServerSelector) Validate added in v1.17.0

func (s *GameServerSelector) Validate(field string) ([]metav1.StatusCause, bool)

Validate validates that the selection fields have valid values

type MetaPatch

type MetaPatch struct {
	Labels      map[string]string `json:"labels,omitempty"`
	Annotations map[string]string `json:"annotations,omitempty"`
}

MetaPatch is the metadata used to patch the GameServer metadata on allocation

func (*MetaPatch) DeepCopy

func (in *MetaPatch) DeepCopy() *MetaPatch

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

func (*MetaPatch) DeepCopyInto

func (in *MetaPatch) DeepCopyInto(out *MetaPatch)

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

func (*MetaPatch) Validate added in v1.21.0

func (mp *MetaPatch) Validate() ([]metav1.StatusCause, bool)

Validate returns if the labels and/or annotations that are to be applied to a `GameServer` post allocation are valid.

type MultiClusterSetting

type MultiClusterSetting struct {
	Enabled        bool                 `json:"enabled,omitempty"`
	PolicySelector metav1.LabelSelector `json:"policySelector,omitempty"`
}

MultiClusterSetting specifies settings for multi-cluster allocation.

func (*MultiClusterSetting) DeepCopy

func (in *MultiClusterSetting) DeepCopy() *MultiClusterSetting

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

func (*MultiClusterSetting) DeepCopyInto

func (in *MultiClusterSetting) DeepCopyInto(out *MultiClusterSetting)

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

type PlayerSelector added in v1.17.0

type PlayerSelector struct {
	MinAvailable int64 `json:"minAvailable,omitempty"`
	MaxAvailable int64 `json:"maxAvailable,omitempty"`
}

PlayerSelector is the filter options for a GameServer based on player counts

func (*PlayerSelector) DeepCopy added in v1.17.0

func (in *PlayerSelector) DeepCopy() *PlayerSelector

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

func (*PlayerSelector) DeepCopyInto added in v1.17.0

func (in *PlayerSelector) DeepCopyInto(out *PlayerSelector)

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

Jump to

Keyboard shortcuts

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