Documentation ¶
Overview ¶
Package gameservers handles management of the GameServer Custom Resource Definition
Index ¶
- Constants
- Variables
- func AddNotInServiceConstraint(gs *carrierv1alpha1.GameServer)
- func ApplyDefaults(gs *carrierv1alpha1.GameServer)
- func CanInPlaceUpdating(gs *carrierv1alpha1.GameServer) bool
- func FindContainer(gss *carrierv1alpha1.GameServerSpec, name string) (int, corev1.Container, error)
- func IsBeforeRunning(gs *carrierv1alpha1.GameServer) bool
- func IsBeingDeleted(gs *carrierv1alpha1.GameServer) bool
- func IsDeletable(gs *carrierv1alpha1.GameServer) bool
- func IsDeletableExist(gs *carrierv1alpha1.GameServer) bool
- func IsDeletableWithGates(gs *carrierv1alpha1.GameServer) bool
- func IsDynamicPortAllocated(gs *carrierv1alpha1.GameServer) bool
- func IsInPlaceUpdating(gs *carrierv1alpha1.GameServer) bool
- func IsLoadBalancerPortExist(gs *carrierv1alpha1.GameServer) bool
- func IsOutOfService(gs *carrierv1alpha1.GameServer) bool
- func IsReadinessExist(gs *carrierv1alpha1.GameServer) bool
- func IsReady(gs *carrierv1alpha1.GameServer) bool
- func IsStopped(gs *carrierv1alpha1.GameServer) bool
- func NotInServiceConstraint() carrierv1alpha1.Constraint
- func SetInPlaceUpdatingStatus(gs *carrierv1alpha1.GameServer, status string)
- type Allocator
- type Controller
- type MinMaxAllocator
Constants ¶
const ( PortType = "Port" PortRangeType = "PortRange" )
const (
// ToBeDeletedTaint is a taint used to make the node unschedulable.
ToBeDeletedTaint = "ToBeDeletedByClusterAutoscaler"
)
Variables ¶
var ( //ErrRangeFull returned when no more free values in the pool. ErrRangeFull = errors.New("range full") )
Functions ¶
func AddNotInServiceConstraint ¶
func AddNotInServiceConstraint(gs *carrierv1alpha1.GameServer)
AddNotInServiceConstraint will add `NotInService` constraint to GameServer Spec.
func ApplyDefaults ¶
func ApplyDefaults(gs *carrierv1alpha1.GameServer)
ApplyDefaults applies default values to the GameServer if they are not already populated
func CanInPlaceUpdating ¶
func CanInPlaceUpdating(gs *carrierv1alpha1.GameServer) bool
CanInPlaceUpdating checks if a GameServer can inplace updating
func FindContainer ¶
func FindContainer(gss *carrierv1alpha1.GameServerSpec, 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 IsBeforeRunning ¶
func IsBeforeRunning(gs *carrierv1alpha1.GameServer) bool
IsBeforeRunning returns if GameServer is not running.
func IsBeingDeleted ¶
func IsBeingDeleted(gs *carrierv1alpha1.GameServer) bool
IsBeingDeleted returns true if the server is in the process of being deleted.
func IsDeletable ¶
func IsDeletable(gs *carrierv1alpha1.GameServer) bool
IsDeletable returns false if the server is currently not deletable
func IsDeletableExist ¶
func IsDeletableExist(gs *carrierv1alpha1.GameServer) bool
IsDeletableExist checks if deletable gates exits
func IsDeletableWithGates ¶
func IsDeletableWithGates(gs *carrierv1alpha1.GameServer) bool
IsDeletableWithGates returns false if the server is currently not deletable and has deletableGates
func IsDynamicPortAllocated ¶
func IsDynamicPortAllocated(gs *carrierv1alpha1.GameServer) bool
IsDynamicPortAllocated checks if ports allocated
func IsInPlaceUpdating ¶
func IsInPlaceUpdating(gs *carrierv1alpha1.GameServer) bool
IsInPlaceUpdating checks if a GameServer is inplace updating
func IsLoadBalancerPortExist ¶
func IsLoadBalancerPortExist(gs *carrierv1alpha1.GameServer) bool
IsLoadBalancerPortExist check if a GameServer requires Load Balancer.
func IsOutOfService ¶
func IsOutOfService(gs *carrierv1alpha1.GameServer) bool
IsOutOfService checks if a GameServer is marked out of service, and a delete candidate
func IsReadinessExist ¶
func IsReadinessExist(gs *carrierv1alpha1.GameServer) bool
IsReadinessExist checks if readiness gates exits
func IsReady ¶
func IsReady(gs *carrierv1alpha1.GameServer) bool
IsReady returns true if the GameServer Status Condition are all OK
func IsStopped ¶
func IsStopped(gs *carrierv1alpha1.GameServer) bool
IsStopped returns true if the server is failed or exited
func NotInServiceConstraint ¶
func NotInServiceConstraint() carrierv1alpha1.Constraint
NotInServiceConstraint describe a constraint that gs should not be in service again.
func SetInPlaceUpdatingStatus ¶
func SetInPlaceUpdatingStatus(gs *carrierv1alpha1.GameServer, status string)
SetInPlaceUpdatingStatus set if it is inplace updating
Types ¶
type Allocator ¶
type Allocator interface { Allocate(string, string, int, bool) ([]int, error) Release(string, string, []int) SetUsed(string, string, []int) }
Allocator is an Interface that can adjust its min/max range. Allocator should be threadsafe
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is a the main GameServer crd controller
func NewController ¶
func NewController( kubeClient kubernetes.Interface, kubeInformerFactory informers.SharedInformerFactory, carrierClient versioned.Interface, carrierInformerFactory externalversions.SharedInformerFactory, minPort, maxPort int) *Controller
NewController returns a new GameServer crd controller
func (*Controller) Run ¶
func (c *Controller) Run(workers int, stop <-chan struct{}) error
Run the GameServer controller. Will block until stop is closed. Runs threadiness number workers to process the rate limited queue
type MinMaxAllocator ¶
type MinMaxAllocator struct {
// contains filtered or unexported fields
}
MinMaxAllocator defines allocator struct.
func NewMinMaxAllocator ¶
func NewMinMaxAllocator(min, max int) *MinMaxAllocator
NewMinMaxAllocator return a new allocator or error based on provided min/max value.
func (*MinMaxAllocator) Release ¶
func (a *MinMaxAllocator) Release(refId, id string, ports []int)
Release free/delete provided value from the allocator.