v1alpha1

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +groupName=autoscaling.internal.knative.dev

Index

Constants

View Source
const (
	// PodAutoscalerConditionReady is set when the revision is starting to materialize
	// runtime resources, and becomes true when those resources are ready.
	PodAutoscalerConditionReady = duckv1alpha1.ConditionReady
	// PodAutoscalerConditionActive is set when the PodAutoscaler's ScaleTargetRef is receiving traffic.
	PodAutoscalerConditionActive duckv1alpha1.ConditionType = "Active"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: autoscaling.InternalGroupName, Version: "v1alpha1"}

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 PodAutoscaler

type PodAutoscaler struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec holds the desired state of the PodAutoscaler (from the client).
	// +optional
	Spec PodAutoscalerSpec `json:"spec,omitempty"`

	// Status communicates the observed state of the PodAutoscaler (from the controller).
	// +optional
	Status PodAutoscalerStatus `json:"status,omitempty"`
}

PodAutoscaler is a Knative abstraction that encapsulates the interface by which Knative components instantiate autoscalers. This definition is an abstraction that may be backed by multiple definitions. For more information, see the Knative Pluggability presentation: https://docs.google.com/presentation/d/10KWynvAJYuOEWy69VBa6bHJVCqIsz1TNdEKosNvcpPY/edit

func (*PodAutoscaler) CheckImmutableFields

func (current *PodAutoscaler) CheckImmutableFields(ctx context.Context, og apis.Immutable) *apis.FieldError

CheckImmutableFields checks the immutability of the PodAutoscaler.

func (*PodAutoscaler) Class

func (pa *PodAutoscaler) Class() string

func (*PodAutoscaler) DeepCopy

func (in *PodAutoscaler) DeepCopy() *PodAutoscaler

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

func (*PodAutoscaler) DeepCopyInto

func (in *PodAutoscaler) DeepCopyInto(out *PodAutoscaler)

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

func (*PodAutoscaler) DeepCopyObject

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

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

func (*PodAutoscaler) GetGroupVersionKind

func (pa *PodAutoscaler) GetGroupVersionKind() schema.GroupVersionKind

func (*PodAutoscaler) ScaleBounds

func (pa *PodAutoscaler) ScaleBounds() (min, max int32)

ScaleBounds returns scale bounds annotations values as a tuple: `(min, max int32)`. The value of 0 for any of min or max means the bound is not set

func (*PodAutoscaler) SetDefaults

func (r *PodAutoscaler) SetDefaults(ctx context.Context)

func (*PodAutoscaler) Target

func (pa *PodAutoscaler) Target() (target int32, ok bool)

Target returns the target annotation value or false if not present.

func (*PodAutoscaler) Validate

func (pa *PodAutoscaler) Validate(ctx context.Context) *apis.FieldError

type PodAutoscalerList

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

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

PodAutoscalerList is a list of PodAutoscaler resources

func (*PodAutoscalerList) DeepCopy

func (in *PodAutoscalerList) DeepCopy() *PodAutoscalerList

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

func (*PodAutoscalerList) DeepCopyInto

func (in *PodAutoscalerList) DeepCopyInto(out *PodAutoscalerList)

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

func (*PodAutoscalerList) DeepCopyObject

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

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

type PodAutoscalerSpec

type PodAutoscalerSpec struct {
	// DeprecatedGeneration was used prior in Kubernetes versions <1.11
	// when metadata.generation was not being incremented by the api server
	//
	// This property will be dropped in future Knative releases and should
	// not be used - use metadata.generation
	//
	// Tracking issue: https://github.com/knative/serving/issues/643
	//
	// +optional
	DeprecatedGeneration int64 `json:"generation,omitempty"`

	// ConcurrencyModel specifies the desired concurrency model
	// (Single or Multi) for the scale target. Defaults to Multi.
	// Deprecated in favor of ContainerConcurrency.
	// +optional
	ConcurrencyModel servingv1alpha1.RevisionRequestConcurrencyModelType `json:"concurrencyModel,omitempty"`

	// ContainerConcurrency specifies the maximum allowed
	// in-flight (concurrent) requests per container of the Revision.
	// Defaults to `0` which means unlimited concurrency.
	// This field replaces ConcurrencyModel. A value of `1`
	// is equivalent to `Single` and `0` is equivalent to `Multi`.
	// +optional
	ContainerConcurrency servingv1alpha1.RevisionContainerConcurrencyType `json:"containerConcurrency,omitempty"`

	// ScaleTargetRef defines the /scale-able resource that this PodAutoscaler
	// is responsible for quickly right-sizing.
	ScaleTargetRef autoscalingv1.CrossVersionObjectReference `json:"scaleTargetRef"`

	// ServiceName holds the name of a core Kubernetes Service resource that
	// load balances over the pods referenced by the ScaleTargetRef.
	ServiceName string `json:"serviceName"`

	// The application-layer protocol. Matches `ProtocolType` inferred from the revision spec.
	ProtocolType net.ProtocolType
}

PodAutoscalerSpec holds the desired state of the PodAutoscaler (from the client).

func (*PodAutoscalerSpec) DeepCopy

func (in *PodAutoscalerSpec) DeepCopy() *PodAutoscalerSpec

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

func (*PodAutoscalerSpec) DeepCopyInto

func (in *PodAutoscalerSpec) DeepCopyInto(out *PodAutoscalerSpec)

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

func (*PodAutoscalerSpec) SetDefaults

func (rs *PodAutoscalerSpec) SetDefaults(ctx context.Context)

func (*PodAutoscalerSpec) Validate

func (rs *PodAutoscalerSpec) Validate(ctx context.Context) *apis.FieldError

Validate validates PodAutoscaler Spec.

type PodAutoscalerStatus

type PodAutoscalerStatus duckv1alpha1.Status

PodAutoscalerStatus communicates the observed state of the PodAutoscaler (from the controller).

func (*PodAutoscalerStatus) CanMarkInactive

func (rs *PodAutoscalerStatus) CanMarkInactive(idlePeriod time.Duration) bool

CanMarkInactive checks whether the pod autoscaler has been in an active state for at least the specified idle period.

func (*PodAutoscalerStatus) CanScaleToZero

func (rs *PodAutoscalerStatus) CanScaleToZero(gracePeriod time.Duration) bool

CanScaleToZero checks whether the pod autoscaler has been in an inactive state for at least the specified grace period.

func (*PodAutoscalerStatus) DeepCopy

func (in *PodAutoscalerStatus) DeepCopy() *PodAutoscalerStatus

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

func (*PodAutoscalerStatus) DeepCopyInto

func (in *PodAutoscalerStatus) DeepCopyInto(out *PodAutoscalerStatus)

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

func (*PodAutoscalerStatus) GetCondition

func (*PodAutoscalerStatus) InitializeConditions

func (rs *PodAutoscalerStatus) InitializeConditions()

func (*PodAutoscalerStatus) IsActivating

func (rs *PodAutoscalerStatus) IsActivating() bool

IsActivating assumes the pod autoscaler is Activating if it is neither Active nor Inactive

func (*PodAutoscalerStatus) IsReady

func (rs *PodAutoscalerStatus) IsReady() bool

IsReady looks at the conditions and if the Status has a condition PodAutoscalerConditionReady returns true if ConditionStatus is True

func (*PodAutoscalerStatus) MarkActivating

func (rs *PodAutoscalerStatus) MarkActivating(reason, message string)

func (*PodAutoscalerStatus) MarkActive

func (rs *PodAutoscalerStatus) MarkActive()

func (*PodAutoscalerStatus) MarkInactive

func (rs *PodAutoscalerStatus) MarkInactive(reason, message string)

func (*PodAutoscalerStatus) MarkResourceFailedCreation

func (rs *PodAutoscalerStatus) MarkResourceFailedCreation(kind, name string)

MarkResourceFailedCreation changes the "Active" condition to false to reflect that a critical resource of the given kind and name was unable to be created.

func (*PodAutoscalerStatus) MarkResourceNotOwned

func (rs *PodAutoscalerStatus) MarkResourceNotOwned(kind, name string)

MarkResourceNotOwned changes the "Active" condition to false to reflect that the resource of the given kind and name has already been created, and we do not own it.

Jump to

Keyboard shortcuts

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