A FleetAutoscaler
's job is to automatically scale up and down a Fleet
in response to demand.
A full FleetAutoscaler
specification is available below and in the
example folder for reference :
apiVersion: "stable.agones.dev/v1alpha1"
kind: FleetAutoscaler
metadata:
name: fleet-autoscaler-example
spec:
fleetName: fleet-example
policy:
type: Buffer
buffer:
bufferSize: 5
minReplicas: 10
maxReplicas: 20
Since Agones defines a new
Custom Resources Definition (CRD)
we can define a new resource using the kind FleetAutoscaler
with the custom group stable.agones.dev
and API
version v1alpha1
.
The spec
field is the actual FleetAutoscaler
specification and it is composed as follows:
fleetName
is name of the fleet to attach to and control. Must be an existingFleet
in the same namespace as thisFleetAutoscaler
.policy
is the autoscaling policytype
is type of the policy. For now, only "Buffer" is availablebuffer
parameters of the buffer policybufferSize
is the size of a buffer of "ready" game server instances The FleetAutoscaler will scale the fleet up and down trying to maintain this buffer, as instances are being allocated or terminated it can be specified either in absolute (i.e. 5) or percentage format (i.e. 5%)minReplicas
is the minimum fleet size to be set by this FleetAutoscaler. if not specified, the minimum fleet size will be bufferSizemaxReplicas
is the maximum fleet size that can be set by this FleetAutoscaler. Required.