v1

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

Package v1 is the v1 version of the API. +groupName=autoscaling.agones.dev

Index

Constants

View Source
const (
	// BufferPolicyType FleetAutoscalerPolicyType is a simple buffering strategy for Ready
	// GameServers
	BufferPolicyType FleetAutoscalerPolicyType = "Buffer"
	// WebhookPolicyType is a simple webhook strategy used for horizontal fleet scaling
	// GameServers
	WebhookPolicyType FleetAutoscalerPolicyType = "Webhook"
	// FixedIntervalSyncType is a simple fixed interval based strategy for trigger autoscaling
	FixedIntervalSyncType FleetAutoscalerSyncType = "FixedInterval"
)

Variables

View Source
var (
	// SchemeBuilder registers our types
	SchemeBuilder = k8sruntime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme local alias for SchemeBuilder.AddToScheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: autoscaling.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type BufferPolicy

type BufferPolicy struct {
	// MaxReplicas is the maximum amount of replicas that the fleet may have.
	// It must be bigger than both MinReplicas and BufferSize
	MaxReplicas int32 `json:"maxReplicas"`

	// MinReplicas is the minimum amount of replicas that the fleet must have
	// If zero, it is ignored.
	// If non zero, it must be smaller than MaxReplicas and bigger than BufferSize
	MinReplicas int32 `json:"minReplicas"`

	// BufferSize defines how many replicas the autoscaler tries to have ready all the time
	// Value can be an absolute number (ex: 5) or a percentage of desired gs instances (ex: 15%)
	// Absolute number is calculated from percentage by rounding up.
	// Example: when this is set to 20%, the autoscaler will make sure that 20%
	//   of the fleet's game server replicas are ready. When this is set to 20,
	//   the autoscaler will make sure that there are 20 available game servers
	// Must be bigger than 0
	// Note: by "ready" we understand in this case "non-allocated"; this is done to ensure robustness
	//       and computation stability in different edge case (fleet just created, not enough
	//       capacity in the cluster etc)
	BufferSize intstr.IntOrString `json:"bufferSize"`
}

BufferPolicy controls the desired behavior of the buffer policy.

func (*BufferPolicy) DeepCopy

func (in *BufferPolicy) DeepCopy() *BufferPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BufferPolicy.

func (*BufferPolicy) DeepCopyInto

func (in *BufferPolicy) DeepCopyInto(out *BufferPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*BufferPolicy) ValidateBufferPolicy

func (b *BufferPolicy) ValidateBufferPolicy(causes []metav1.StatusCause) []metav1.StatusCause

ValidateBufferPolicy validates the FleetAutoscaler Buffer policy settings

type FixedIntervalSync added in v1.17.0

type FixedIntervalSync struct {
	// Seconds defines how often we run fleet autoscaling in seconds
	Seconds int32 `json:"seconds"`
}

FixedIntervalSync controls the desired behavior of the fixed interval based sync.

func (*FixedIntervalSync) DeepCopy added in v1.17.0

func (in *FixedIntervalSync) DeepCopy() *FixedIntervalSync

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FixedIntervalSync.

func (*FixedIntervalSync) DeepCopyInto added in v1.17.0

func (in *FixedIntervalSync) DeepCopyInto(out *FixedIntervalSync)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FixedIntervalSync) ValidateFixedIntervalSync added in v1.17.0

func (i *FixedIntervalSync) ValidateFixedIntervalSync(causes []metav1.StatusCause) []metav1.StatusCause

ValidateFixedIntervalSync validates the FixedIntervalSync settings

type FleetAutoscaleRequest

type FleetAutoscaleRequest struct {
	// UID is an identifier for the individual request/response. It allows us to distinguish instances of requests which are
	// otherwise identical (parallel requests, requests when earlier requests did not modify etc)
	// The UID is meant to track the round trip (request/response) between the Autoscaler and the WebHook, not the user request.
	// It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.
	UID types.UID `json:"uid"`
	// Name is the name of the Fleet being scaled
	Name string `json:"name"`
	// Namespace is the namespace associated with the request (if any).
	Namespace string `json:"namespace"`
	// The Fleet's status values
	Status agonesv1.FleetStatus `json:"status"`
}

FleetAutoscaleRequest defines the request to webhook autoscaler endpoint

func (*FleetAutoscaleRequest) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscaleRequest.

func (*FleetAutoscaleRequest) DeepCopyInto

func (in *FleetAutoscaleRequest) DeepCopyInto(out *FleetAutoscaleRequest)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FleetAutoscaleResponse

type FleetAutoscaleResponse struct {
	// UID is an identifier for the individual request/response.
	// This should be copied over from the corresponding FleetAutoscaleRequest.
	UID types.UID `json:"uid"`
	// Set to false if no scaling should occur to the Fleet
	Scale bool `json:"scale"`
	// The targeted replica count
	Replicas int32 `json:"replicas"`
}

FleetAutoscaleResponse defines the response of webhook autoscaler endpoint

func (*FleetAutoscaleResponse) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscaleResponse.

func (*FleetAutoscaleResponse) DeepCopyInto

func (in *FleetAutoscaleResponse) DeepCopyInto(out *FleetAutoscaleResponse)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FleetAutoscaleReview

type FleetAutoscaleReview struct {
	Request  *FleetAutoscaleRequest  `json:"request"`
	Response *FleetAutoscaleResponse `json:"response"`
}

FleetAutoscaleReview is passed to the webhook with a populated Request value, and then returned with a populated Response.

func (*FleetAutoscaleReview) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscaleReview.

func (*FleetAutoscaleReview) DeepCopyInto

func (in *FleetAutoscaleReview) DeepCopyInto(out *FleetAutoscaleReview)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FleetAutoscaler

type FleetAutoscaler struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   FleetAutoscalerSpec   `json:"spec"`
	Status FleetAutoscalerStatus `json:"status"`
}

FleetAutoscaler is the data structure for a FleetAutoscaler resource

func (*FleetAutoscaler) ApplyDefaults added in v1.17.0

func (fas *FleetAutoscaler) ApplyDefaults()

ApplyDefaults applies default values to the FleetAutoscaler

func (*FleetAutoscaler) DeepCopy

func (in *FleetAutoscaler) DeepCopy() *FleetAutoscaler

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscaler.

func (*FleetAutoscaler) DeepCopyInto

func (in *FleetAutoscaler) DeepCopyInto(out *FleetAutoscaler)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FleetAutoscaler) DeepCopyObject

func (in *FleetAutoscaler) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*FleetAutoscaler) Validate

func (fas *FleetAutoscaler) Validate(causes []metav1.StatusCause) []metav1.StatusCause

Validate validates the FleetAutoscaler scaling settings

type FleetAutoscalerList

type FleetAutoscalerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	Items []FleetAutoscaler `json:"items"`
}

FleetAutoscalerList is a list of Fleet Scaler resources

func (*FleetAutoscalerList) DeepCopy

func (in *FleetAutoscalerList) DeepCopy() *FleetAutoscalerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscalerList.

func (*FleetAutoscalerList) DeepCopyInto

func (in *FleetAutoscalerList) DeepCopyInto(out *FleetAutoscalerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*FleetAutoscalerList) DeepCopyObject

func (in *FleetAutoscalerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type FleetAutoscalerPolicy

type FleetAutoscalerPolicy struct {
	// Type of autoscaling policy.
	Type FleetAutoscalerPolicyType `json:"type"`

	// Buffer policy config params. Present only if FleetAutoscalerPolicyType = Buffer.
	// +optional
	Buffer *BufferPolicy `json:"buffer,omitempty"`
	// Webhook policy config params. Present only if FleetAutoscalerPolicyType = Webhook.
	// +optional
	Webhook *WebhookPolicy `json:"webhook,omitempty"`
}

FleetAutoscalerPolicy describes how to scale a fleet

func (*FleetAutoscalerPolicy) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscalerPolicy.

func (*FleetAutoscalerPolicy) DeepCopyInto

func (in *FleetAutoscalerPolicy) DeepCopyInto(out *FleetAutoscalerPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FleetAutoscalerPolicyType

type FleetAutoscalerPolicyType string

FleetAutoscalerPolicyType is the policy for autoscaling for a given Fleet

type FleetAutoscalerSpec

type FleetAutoscalerSpec struct {
	FleetName string `json:"fleetName"`

	// Autoscaling policy
	Policy FleetAutoscalerPolicy `json:"policy"`
	// [Stage:Beta]
	// [FeatureFlag:CustomFasSyncInterval]
	// Sync defines when FleetAutoscalers runs autoscaling
	// +optional
	Sync *FleetAutoscalerSync `json:"sync,omitempty"`
}

FleetAutoscalerSpec is the spec for a Fleet Scaler

func (*FleetAutoscalerSpec) DeepCopy

func (in *FleetAutoscalerSpec) DeepCopy() *FleetAutoscalerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscalerSpec.

func (*FleetAutoscalerSpec) DeepCopyInto

func (in *FleetAutoscalerSpec) DeepCopyInto(out *FleetAutoscalerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FleetAutoscalerStatus

type FleetAutoscalerStatus struct {
	// CurrentReplicas is the current number of gameserver replicas
	// of the fleet managed by this autoscaler, as last seen by the autoscaler
	CurrentReplicas int32 `json:"currentReplicas"`

	// DesiredReplicas is the desired number of gameserver replicas
	// of the fleet managed by this autoscaler, as last calculated by the autoscaler
	DesiredReplicas int32 `json:"desiredReplicas"`

	// lastScaleTime is the last time the FleetAutoscaler scaled the attached fleet,
	// +optional
	LastScaleTime *metav1.Time `json:"lastScaleTime"`

	// AbleToScale indicates that we can access the target fleet
	AbleToScale bool `json:"ableToScale"`

	// ScalingLimited indicates that the calculated scale would be above or below the range
	// defined by MinReplicas and MaxReplicas, and has thus been capped.
	ScalingLimited bool `json:"scalingLimited"`
}

FleetAutoscalerStatus defines the current status of a FleetAutoscaler

func (*FleetAutoscalerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscalerStatus.

func (*FleetAutoscalerStatus) DeepCopyInto

func (in *FleetAutoscalerStatus) DeepCopyInto(out *FleetAutoscalerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FleetAutoscalerSync added in v1.17.0

type FleetAutoscalerSync struct {
	// Type of autoscaling sync.
	Type FleetAutoscalerSyncType `json:"type"`

	// FixedInterval config params. Present only if FleetAutoscalerSyncType = FixedInterval.
	// +optional
	FixedInterval FixedIntervalSync `json:"fixedInterval"`
}

FleetAutoscalerSync describes when to sync a fleet

func (*FleetAutoscalerSync) DeepCopy added in v1.17.0

func (in *FleetAutoscalerSync) DeepCopy() *FleetAutoscalerSync

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetAutoscalerSync.

func (*FleetAutoscalerSync) DeepCopyInto added in v1.17.0

func (in *FleetAutoscalerSync) DeepCopyInto(out *FleetAutoscalerSync)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FleetAutoscalerSyncType added in v1.17.0

type FleetAutoscalerSyncType string

FleetAutoscalerSyncType is the sync strategy for a given Fleet

type WebhookPolicy

type WebhookPolicy admregv1.WebhookClientConfig

WebhookPolicy controls the desired behavior of the webhook policy. It contains the description of the webhook autoscaler service used to form url which is accessible inside the cluster

func (*WebhookPolicy) DeepCopy

func (in *WebhookPolicy) DeepCopy() *WebhookPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookPolicy.

func (*WebhookPolicy) DeepCopyInto

func (in *WebhookPolicy) DeepCopyInto(out *WebhookPolicy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*WebhookPolicy) ValidateWebhookPolicy

func (w *WebhookPolicy) ValidateWebhookPolicy(causes []metav1.StatusCause) []metav1.StatusCause

ValidateWebhookPolicy validates the FleetAutoscaler Webhook policy settings

Jump to

Keyboard shortcuts

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