Documentation
¶
Overview ¶
Package gameservers handles management of the GameServer Custom Resource Definition
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is a the main GameServer crd controller
func NewController ¶
func NewController( controllerHooks cloudproduct.ControllerHooksInterface, health healthcheck.Handler, portRanges map[string]portallocator.PortRange, sidecarImage string, alwaysPullSidecarImage bool, sidecarCPURequest resource.Quantity, sidecarCPULimit resource.Quantity, sidecarMemoryRequest resource.Quantity, sidecarMemoryLimit resource.Quantity, sidecarRunAsUser int, sidecarRequestsRateLimit time.Duration, sdkServiceAccount string, kubeClient kubernetes.Interface, kubeInformerFactory informers.SharedInformerFactory, extClient extclientset.Interface, agonesClient versioned.Interface, agonesInformerFactory externalversions.SharedInformerFactory, ) *Controller
NewController returns a new gameserver crd controller
type Extensions ¶ added in v1.29.0
type Extensions struct {
// contains filtered or unexported fields
}
Extensions struct contains what is needed to bind webhook handlers
func NewExtensions ¶ added in v1.29.0
func NewExtensions(apiHooks agonesv1.APIHooks, wh *webhooks.WebHook) *Extensions
NewExtensions binds the handlers to the webhook outside the initialization of the controller initializes a new logger for extensions.
type HealthController ¶
type HealthController struct {
// contains filtered or unexported fields
}
HealthController watches Pods, and applies an Unhealthy state if certain pods crash, or can't be assigned a port, and other similar type conditions.
func NewHealthController ¶
func NewHealthController( health healthcheck.Handler, kubeClient kubernetes.Interface, agonesClient versioned.Interface, kubeInformerFactory informers.SharedInformerFactory, agonesInformerFactory externalversions.SharedInformerFactory, waitOnFreePorts bool) *HealthController
NewHealthController returns a HealthController
type MigrationController ¶ added in v1.3.0
type MigrationController struct {
// contains filtered or unexported fields
}
MigrationController watches for if a Pod is migrated/a maintenance event happens on a node, and a Pod is recreated with a new Address for a GameServer
func NewMigrationController ¶ added in v1.3.0
func NewMigrationController(health healthcheck.Handler, kubeClient kubernetes.Interface, agonesClient versioned.Interface, kubeInformerFactory informers.SharedInformerFactory, agonesInformerFactory externalversions.SharedInformerFactory, syncPodPortsToGameServer func(*agonesv1.GameServer, *corev1.Pod) error, ) *MigrationController
NewMigrationController returns a MigrationController
type MissingPodController ¶ added in v1.4.0
type MissingPodController struct {
// contains filtered or unexported fields
}
MissingPodController makes sure that any GameServer that isn't in a Scheduled or Unhealthy state and is either missing a Pod, or has a Pod in a Failed state, is moved to Unhealthy.
It's possible that a GameServer is missing its associated pod due to unexpected controller downtime or if the Pod is deleted with no subsequent Delete event. Similarly, a Pod can reach the Failed phase (e.g. non-zero exit with SidecarContainers enabled) without a corresponding Unhealthy transition being triggered.
Since resync on the controller is every 30 seconds, even if there is some time in which a GameServer is in a broken state, it will eventually move to Unhealthy, and get replaced (if in a Fleet).
func NewMissingPodController ¶ added in v1.4.0
func NewMissingPodController(health healthcheck.Handler, kubeClient kubernetes.Interface, agonesClient versioned.Interface, kubeInformerFactory informers.SharedInformerFactory, agonesInformerFactory externalversions.SharedInformerFactory) *MissingPodController
NewMissingPodController returns a MissingPodController
type NodeCount ¶ added in v0.9.0
type NodeCount struct {
// Ready is ready count
Ready int64
// Allocated is allocated out
Allocated int64
}
NodeCount is just a convenience data structure for keeping relevant GameServer counts about Nodes
type PerNodeCounter ¶ added in v0.9.0
type PerNodeCounter struct {
// contains filtered or unexported fields
}
PerNodeCounter counts how many Allocated and Ready GameServers currently exist on each node. This is useful for scheduling allocations, fleet management mostly under a Packed strategy
func NewPerNodeCounter ¶ added in v0.9.0
func NewPerNodeCounter( kubeInformerFactory informers.SharedInformerFactory, agonesInformerFactory externalversions.SharedInformerFactory) *PerNodeCounter
NewPerNodeCounter returns a new PerNodeCounter
func (*PerNodeCounter) Counts ¶ added in v0.9.0
func (pnc *PerNodeCounter) Counts() map[string]NodeCount
Counts returns the NodeCount map in a thread safe way
type SucceededController ¶ added in v1.51.0
type SucceededController struct {
// contains filtered or unexported fields
}
SucceededController changes the state of a GameServer to Shutdown when its Pod has a backing state of Succeeded.
func NewSucceededController ¶ added in v1.51.0
func NewSucceededController(health healthcheck.Handler, kubeClient kubernetes.Interface, agonesClient versioned.Interface, kubeInformerFactory informers.SharedInformerFactory, agonesInformerFactory externalversions.SharedInformerFactory) *SucceededController
NewSucceededController creates a new SucceededController and sets up event handlers.