Show / Hide Table of Contents

Class V2HPAScalingRules

HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.

Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.

The tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.)

Inheritance
object
V2HPAScalingRules
Implements
IEquatable<V2HPAScalingRules>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: k8s.Models
Assembly: KubernetesClient.dll
Syntax
public record V2HPAScalingRules : IEquatable<V2HPAScalingRules>

Constructors

View Source

V2HPAScalingRules()

Declaration
public V2HPAScalingRules()
View Source

V2HPAScalingRules(V2HPAScalingRules)

Declaration
protected V2HPAScalingRules(V2HPAScalingRules original)
Parameters
Type Name Description
V2HPAScalingRules original

Properties

View Source

EqualityContract

Declaration
protected virtual Type EqualityContract { get; }
Property Value
Type Description
Type
View Source

Policies

policies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.

Declaration
[JsonPropertyName("policies")]
public IList<V2HPAScalingPolicy> Policies { get; set; }
Property Value
Type Description
IList<V2HPAScalingPolicy>
View Source

SelectPolicy

selectPolicy is used to specify which policy should be used. If not set, the default value Max is used.

Declaration
[JsonPropertyName("selectPolicy")]
public string SelectPolicy { get; set; }
Property Value
Type Description
string
View Source

StabilizationWindowSeconds

stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).

Declaration
[JsonPropertyName("stabilizationWindowSeconds")]
public int? StabilizationWindowSeconds { get; set; }
Property Value
Type Description
int?
View Source

Tolerance

tolerance is the tolerance on the ratio between the current and desired metric value under which no updates are made to the desired number of replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not set, the default cluster-wide tolerance is applied (by default 10%).

For example, if autoscaling is configured with a memory consumption target of 100Mi, and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be triggered when the actual consumption falls below 95Mi or exceeds 101Mi.

This is an alpha field and requires enabling the HPAConfigurableTolerance feature gate.

Declaration
[JsonPropertyName("tolerance")]
public ResourceQuantity Tolerance { get; set; }
Property Value
Type Description
ResourceQuantity

Methods

View Source

Equals(object?)

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
object.Equals(object)
View Source

Equals(V2HPAScalingRules?)

Declaration
public virtual bool Equals(V2HPAScalingRules? other)
Parameters
Type Name Description
V2HPAScalingRules other
Returns
Type Description
bool
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
object.GetHashCode()
View Source

PrintMembers(StringBuilder)

Declaration
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
Type Name Description
StringBuilder builder
Returns
Type Description
bool
View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Operators

View Source

operator ==(V2HPAScalingRules?, V2HPAScalingRules?)

Declaration
public static bool operator ==(V2HPAScalingRules? left, V2HPAScalingRules? right)
Parameters
Type Name Description
V2HPAScalingRules left
V2HPAScalingRules right
Returns
Type Description
bool
View Source

operator !=(V2HPAScalingRules?, V2HPAScalingRules?)

Declaration
public static bool operator !=(V2HPAScalingRules? left, V2HPAScalingRules? right)
Parameters
Type Name Description
V2HPAScalingRules left
V2HPAScalingRules right
Returns
Type Description
bool

Implements

IEquatable<T>
  • View Source
In this article
Back to top Generated by DocFX