Class V2HorizontalPodAutoscalerSpec

java.lang.Object
io.kubernetes.client.openapi.models.V2HorizontalPodAutoscalerSpec

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2024-10-04T19:37:38.574271Z[Etc/UTC]", comments="Generator version: 7.6.0") public class V2HorizontalPodAutoscalerSpec extends Object
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
  • Field Details

  • Constructor Details

    • V2HorizontalPodAutoscalerSpec

      public V2HorizontalPodAutoscalerSpec()
  • Method Details

    • behavior

    • getBehavior

      @Nullable public V2HorizontalPodAutoscalerBehavior getBehavior()
      Get behavior
      Returns:
      behavior
    • setBehavior

      public void setBehavior(V2HorizontalPodAutoscalerBehavior behavior)
    • maxReplicas

      public V2HorizontalPodAutoscalerSpec maxReplicas(Integer maxReplicas)
    • getMaxReplicas

      @Nonnull public Integer getMaxReplicas()
      maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.
      Returns:
      maxReplicas
    • setMaxReplicas

      public void setMaxReplicas(Integer maxReplicas)
    • metrics

      public V2HorizontalPodAutoscalerSpec metrics(List<V2MetricSpec> metrics)
    • addMetricsItem

      public V2HorizontalPodAutoscalerSpec addMetricsItem(V2MetricSpec metricsItem)
    • getMetrics

      @Nullable public List<V2MetricSpec> getMetrics()
      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.
      Returns:
      metrics
    • setMetrics

      public void setMetrics(List<V2MetricSpec> metrics)
    • minReplicas

      public V2HorizontalPodAutoscalerSpec minReplicas(Integer minReplicas)
    • getMinReplicas

      @Nullable public Integer getMinReplicas()
      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.
      Returns:
      minReplicas
    • setMinReplicas

      public void setMinReplicas(Integer minReplicas)
    • scaleTargetRef

      public V2HorizontalPodAutoscalerSpec scaleTargetRef(V2CrossVersionObjectReference scaleTargetRef)
    • getScaleTargetRef

      @Nonnull public V2CrossVersionObjectReference getScaleTargetRef()
      Get scaleTargetRef
      Returns:
      scaleTargetRef
    • setScaleTargetRef

      public void setScaleTargetRef(V2CrossVersionObjectReference scaleTargetRef)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to V2HorizontalPodAutoscalerSpec
    • fromJson

      public static V2HorizontalPodAutoscalerSpec fromJson(String jsonString) throws IOException
      Create an instance of V2HorizontalPodAutoscalerSpec given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V2HorizontalPodAutoscalerSpec
      Throws:
      IOException - if the JSON string is invalid with respect to V2HorizontalPodAutoscalerSpec
    • toJson

      public String toJson()
      Convert an instance of V2HorizontalPodAutoscalerSpec to an JSON string
      Returns:
      JSON string