Documentation ¶
Overview ¶
+k8s:deepcopy-gen=package +groupName=autoscaling.internal.knative.dev
Index ¶
- Constants
- Variables
- func Kind(kind string) schema.GroupKind
- func Resource(resource string) schema.GroupResource
- type PodAutoscaler
- func (pa *PodAutoscaler) Class() string
- func (in *PodAutoscaler) DeepCopy() *PodAutoscaler
- func (in *PodAutoscaler) DeepCopyInto(out *PodAutoscaler)
- func (in *PodAutoscaler) DeepCopyObject() runtime.Object
- func (pa *PodAutoscaler) GetGroupVersionKind() schema.GroupVersionKind
- func (pa *PodAutoscaler) PanicThresholdPercentage() (percentage float64, ok bool)
- func (pa *PodAutoscaler) PanicWindowPercentage() (percentage float64, ok bool)
- func (pa *PodAutoscaler) ScaleBounds() (min, max int32)
- func (r *PodAutoscaler) SetDefaults(ctx context.Context)
- func (pa *PodAutoscaler) Target() (target int32, ok bool)
- func (pa *PodAutoscaler) Validate(ctx context.Context) *apis.FieldError
- func (pa *PodAutoscaler) Window() (window time.Duration, ok bool)
- type PodAutoscalerList
- type PodAutoscalerSpec
- type PodAutoscalerStatus
- func (pas *PodAutoscalerStatus) CanMarkInactive(idlePeriod time.Duration) bool
- func (pas *PodAutoscalerStatus) CanScaleToZero(gracePeriod time.Duration) bool
- func (in *PodAutoscalerStatus) DeepCopy() *PodAutoscalerStatus
- func (in *PodAutoscalerStatus) DeepCopyInto(out *PodAutoscalerStatus)
- func (pas *PodAutoscalerStatus) GetCondition(t apis.ConditionType) *apis.Condition
- func (pas *PodAutoscalerStatus) InitializeConditions()
- func (pas *PodAutoscalerStatus) IsActivating() bool
- func (pas *PodAutoscalerStatus) IsInactive() bool
- func (pas *PodAutoscalerStatus) IsReady() bool
- func (pas *PodAutoscalerStatus) MarkActivating(reason, message string)
- func (pas *PodAutoscalerStatus) MarkActive()
- func (pas *PodAutoscalerStatus) MarkInactive(reason, message string)
- func (pas *PodAutoscalerStatus) MarkResourceFailedCreation(kind, name string)
- func (pas *PodAutoscalerStatus) MarkResourceNotOwned(kind, name string)
- type PodScalable
- type PodScalableList
- type PodScalableSpec
- type PodScalableStatus
Constants ¶
const ( // PodAutoscalerConditionReady is set when the revision is starting to materialize // runtime resources, and becomes true when those resources are ready. PodAutoscalerConditionReady = apis.ConditionReady // PodAutoscalerConditionActive is set when the PodAutoscaler's ScaleTargetRef is receiving traffic. PodAutoscalerConditionActive apis.ConditionType = "Active" )
Variables ¶
var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: autoscaling.InternalGroupName, Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
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) 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 (pa *PodAutoscaler) GetGroupVersionKind() schema.GroupVersionKind
func (*PodAutoscaler) PanicThresholdPercentage ¶ added in v0.6.0
func (pa *PodAutoscaler) PanicThresholdPercentage() (percentage float64, ok bool)
PanicThresholdPercentage return the panic target annotation value or false if not present.
func (*PodAutoscaler) PanicWindowPercentage ¶ added in v0.6.0
func (pa *PodAutoscaler) PanicWindowPercentage() (percentage float64, ok bool)
PanicWindowPercentage returns panic window annotation value or false if not present.
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 ¶ added in v0.4.0
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"` // DeprecatedConcurrencyModel no longer does anything, use ContainerConcurrency. // +optional DeprecatedConcurrencyModel 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 servingv1beta1.RevisionContainerConcurrencyType `json:"containerConcurrency,omitempty"` // ScaleTargetRef defines the /scale-able resource that this PodAutoscaler // is responsible for quickly right-sizing. ScaleTargetRef corev1.ObjectReference `json:"scaleTargetRef"` // DeprecatedServiceName holds the name of a core Kubernetes Service resource that // load balances over the pods referenced by the ScaleTargetRef. DeprecatedServiceName 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 struct { duckv1beta1.Status // ServiceName is the K8s Service name that serves the revision, scaled by this PA. // The service is created and owned by the ServerlessService object owned by this PA. ServiceName string `json:"serviceName"` }
PodAutoscalerStatus communicates the observed state of the PodAutoscaler (from the controller).
func (*PodAutoscalerStatus) CanMarkInactive ¶ added in v0.3.0
func (pas *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 (pas *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 (pas *PodAutoscalerStatus) GetCondition(t apis.ConditionType) *apis.Condition
GetCondition gets the condition `t`.
func (*PodAutoscalerStatus) InitializeConditions ¶
func (pas *PodAutoscalerStatus) InitializeConditions()
InitializeConditions initializes the conditionhs of the PA.
func (*PodAutoscalerStatus) IsActivating ¶ added in v0.3.0
func (pas *PodAutoscalerStatus) IsActivating() bool
IsActivating returns true if the pod autoscaler is Activating if it is neither Active nor Inactive
func (*PodAutoscalerStatus) IsInactive ¶ added in v0.6.0
func (pas *PodAutoscalerStatus) IsInactive() bool
IsInactive returns true if the pod autoscaler is Inactive.
func (*PodAutoscalerStatus) IsReady ¶
func (pas *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 (pas *PodAutoscalerStatus) MarkActivating(reason, message string)
MarkActivating marks the PA as activating.
func (*PodAutoscalerStatus) MarkActive ¶
func (pas *PodAutoscalerStatus) MarkActive()
MarkActive marks the PA active.
func (*PodAutoscalerStatus) MarkInactive ¶
func (pas *PodAutoscalerStatus) MarkInactive(reason, message string)
MarkInactive marks the PA as inactive.
func (*PodAutoscalerStatus) MarkResourceFailedCreation ¶ added in v0.4.0
func (pas *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 ¶ added in v0.4.0
func (pas *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.
type PodScalable ¶ added in v0.6.0
type PodScalable struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec PodScalableSpec `json:"spec"` Status PodScalableStatus `json:"status"` }
PodScalable is a duck type that the resources referenced by the PodAutoscaler's ScaleTargetRef must implement. They must also implement the `/scale` sub-resource for use with `/scale` based implementations (e.g. HPA), but this further constrains the shape the referenced resources may take.
func (*PodScalable) DeepCopy ¶ added in v0.6.0
func (in *PodScalable) DeepCopy() *PodScalable
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodScalable.
func (*PodScalable) DeepCopyInto ¶ added in v0.6.0
func (in *PodScalable) DeepCopyInto(out *PodScalable)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PodScalable) DeepCopyObject ¶ added in v0.6.0
func (in *PodScalable) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*PodScalable) GetFullType ¶ added in v0.6.0
func (*PodScalable) GetFullType() duck.Populatable
GetFullType implements duck.Implementable
func (*PodScalable) GetListType ¶ added in v0.6.0
func (*PodScalable) GetListType() runtime.Object
GetListType implements apis.Listable
func (*PodScalable) Populate ¶ added in v0.6.0
func (t *PodScalable) Populate()
Populate implements duck.Populatable
type PodScalableList ¶ added in v0.6.0
type PodScalableList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []PodScalable `json:"items"` }
PodScalableList is a list of PodScalable resources
func (*PodScalableList) DeepCopy ¶ added in v0.6.0
func (in *PodScalableList) DeepCopy() *PodScalableList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodScalableList.
func (*PodScalableList) DeepCopyInto ¶ added in v0.6.0
func (in *PodScalableList) DeepCopyInto(out *PodScalableList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PodScalableList) DeepCopyObject ¶ added in v0.6.0
func (in *PodScalableList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PodScalableSpec ¶ added in v0.6.0
type PodScalableSpec struct { Replicas *int32 `json:"replicas,omitempty"` Selector *metav1.LabelSelector `json:"selector"` Template corev1.PodTemplateSpec `json:"template"` }
PodScalableSpec is the specification for the desired state of a PodScalable (or at least our shared portion).
func (*PodScalableSpec) DeepCopy ¶ added in v0.6.0
func (in *PodScalableSpec) DeepCopy() *PodScalableSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodScalableSpec.
func (*PodScalableSpec) DeepCopyInto ¶ added in v0.6.0
func (in *PodScalableSpec) DeepCopyInto(out *PodScalableSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PodScalableStatus ¶ added in v0.6.0
type PodScalableStatus struct {
Replicas int32 `json:"replicas,omitempty"`
}
PodScalableStatus is the observed state of a PodScalable (or at least our shared portion).
func (*PodScalableStatus) DeepCopy ¶ added in v0.6.0
func (in *PodScalableStatus) DeepCopy() *PodScalableStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodScalableStatus.
func (*PodScalableStatus) DeepCopyInto ¶ added in v0.6.0
func (in *PodScalableStatus) DeepCopyInto(out *PodScalableStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.