HorizontalPodAutoscalerSpec class

HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.

Constructors

HorizontalPodAutoscalerSpec({HorizontalPodAutoscalerBehavior? behavior, required int maxReplicas, List<MetricSpec>? metrics, int? minReplicas, required CrossVersionObjectReference scaleTargetRef})
The main constructor.
const
HorizontalPodAutoscalerSpec.fromJson(Map<String, dynamic> json)
Creates a HorizontalPodAutoscalerSpec from JSON data.

Properties

behavior HorizontalPodAutoscalerBehavior?
Behavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively). If not set, the default HPAScalingRules for scale up and scale down are used.
final
hashCode int
The hash code for this object.
no setterinherited
maxReplicas int
MaxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.
final
metrics List<MetricSpec>?
Metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization.
final
minReplicas int?
MinReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleTargetRef CrossVersionObjectReference
ScaleTargetRef points to the target resource to scale, and is used to the pods for which metrics should be collected, as well as to actually change the replica count.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object>
Converts a HorizontalPodAutoscalerSpec instance to JSON data.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

listFromJson(Iterable<Map<String, dynamic>> list) List<HorizontalPodAutoscalerSpec>
Creates a list of HorizontalPodAutoscalerSpec from JSON data.