gameserverallocations

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package gameserverallocations handles management of allocating Ready GameServers via selectors

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoGameServerReady is returned when there are no Ready GameServers
	// available
	ErrNoGameServerReady = errors.New("Could not find a Ready GameServer")
)

Functions

This section is empty.

Types

type AllocationCounter

type AllocationCounter struct {
	// contains filtered or unexported fields
}

AllocationCounter counts how many Allocated and Ready GameServers currently exist on each node. This is useful for scheduling allocations on the right Nodes.

func NewAllocationCounter

func NewAllocationCounter(
	kubeInformerFactory informers.SharedInformerFactory,
	agonesInformerFactory externalversions.SharedInformerFactory) *AllocationCounter

NewAllocationCounter returns a new AllocationCounter

func (*AllocationCounter) Counts

func (ac *AllocationCounter) Counts() map[string]NodeCount

Counts returns the NodeCount map in a thread safe way

func (*AllocationCounter) Run

func (ac *AllocationCounter) Run(stop <-chan struct{}) error

Run sets up the current state GameServer counts across nodes

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller is a the GameServerAllocation controller

func NewController

func NewController(wh *webhooks.WebHook,
	health healthcheck.Handler,
	allocationMutex *sync.Mutex,
	kubeClient kubernetes.Interface,
	kubeInformerFactory informers.SharedInformerFactory,
	extClient extclientset.Interface,
	agonesClient versioned.Interface,
	agonesInformerFactory externalversions.SharedInformerFactory) *Controller

NewController returns a controller for a GameServerAllocation

func (*Controller) Run

func (c *Controller) Run(workers int, stop <-chan struct{}) error

Run runs this controller. Will block until stop is closed. Runs threadiness number workers to process the rate limited queue Probably only needs 1 worker, as its just deleting unallocated GameServerAllocations

type NodeCount

type NodeCount struct {
	// contains filtered or unexported fields
}

NodeCount is just a convenience data structure for keeping relevant GameServer counts about Nodes

Jump to

Keyboard shortcuts

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