Documentation ¶
Overview ¶
Package portallocator defines a generic port allocator for game servers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // Run sets up the current state of port allocations and // starts tracking Pod and Node changes Run(ctx context.Context) error // Allocate assigns a port to the GameServer and returns it. Allocate(gs *agonesv1.GameServer) *agonesv1.GameServer // DeAllocate marks the given ports as no longer allocated DeAllocate(gs *agonesv1.GameServer) }
Interface manages the dynamic port allocation strategy.
The portallocator does not currently support mixing static portAllocations (or any pods with defined HostPort) within the dynamic port range other than the ones it coordinates.
func New ¶
func New(minPort, maxPort int32, kubeInformerFactory informers.SharedInformerFactory, agonesInformerFactory externalversions.SharedInformerFactory) Interface
New returns a new dynamic port allocator. minPort and maxPort are the top and bottom portAllocations that can be allocated in the range for the game servers.
Click to show internal directories.
Click to hide internal directories.