v1

package
v1.10.0-rc Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

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

Index

Constants

This section is empty.

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 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) 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

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"
)

type FleetAutoscalerSpec

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

	// Autoscaling policy
	Policy FleetAutoscalerPolicy `json:"policy"`
}

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 WebhookPolicy

type WebhookPolicy admregv1b.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