v1alpha1

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2019 License: Apache-2.0 Imports: 14 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(og apis.Immutable) *apis.FieldError

func (*PodAutoscaler) Class added in v0.3.0

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 added in v0.3.0

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

func (*PodAutoscaler) MetricTarget added in v0.3.0

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

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

func (*PodAutoscaler) Validate

func (rt *PodAutoscaler) Validate() *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 {
	// TODO: Generation does not work correctly with CRD. They are scrubbed
	// by the APIserver (https://github.com/kubernetes/kubernetes/issues/58778)
	// So, we add Generation here. Once that gets fixed, remove this and use
	// ObjectMeta.Generation instead.
	// +optional
	Generation 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"`
}

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

func (*PodAutoscalerSpec) Validate

func (rs *PodAutoscalerSpec) Validate() *apis.FieldError

type PodAutoscalerStatus

type PodAutoscalerStatus struct {
	// Conditions communicates information about ongoing/complete
	// reconciliation processes that bring the "spec" inline with the observed
	// state of the world.
	// +optional
	Conditions duckv1alpha1.Conditions `json:"conditions,omitempty"`
}

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

func (*PodAutoscalerStatus) CanMarkInactive added in v0.3.0

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

func (rs *PodAutoscalerStatus) GetConditions() duckv1alpha1.Conditions

GetConditions returns the Conditions array. This enables generic handling of conditions by implementing the duckv1alpha1.Conditions interface.

func (*PodAutoscalerStatus) InitializeConditions

func (rs *PodAutoscalerStatus) InitializeConditions()

func (*PodAutoscalerStatus) IsActivating added in v0.3.0

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

func (rs *PodAutoscalerStatus) SetConditions(conditions duckv1alpha1.Conditions)

SetConditions sets the Conditions array. This enables generic handling of conditions by implementing the duckv1alpha1.Conditions interface.

Jump to

Keyboard shortcuts

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