Class HorizontalPodAutoscalerSpec

  • All Implemented Interfaces:
    com.marcnuri.yakc.model.Model

    public class HorizontalPodAutoscalerSpec
    extends java.lang.Object
    implements com.marcnuri.yakc.model.Model
    HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
    • Constructor Detail

      • HorizontalPodAutoscalerSpec

        public HorizontalPodAutoscalerSpec​(@NonNull
                                           @NonNull java.lang.Number maxReplicas,
                                           java.util.List<MetricSpec> metrics,
                                           java.lang.Number minReplicas,
                                           @NonNull
                                           @NonNull CrossVersionObjectReference scaleTargetRef)
      • HorizontalPodAutoscalerSpec

        public HorizontalPodAutoscalerSpec()
    • Method Detail

      • getMaxReplicas

        @NonNull
        public @NonNull java.lang.Number getMaxReplicas()
        maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.
      • getMetrics

        public java.util.List<MetricSpec> 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.
      • getMinReplicas

        public java.lang.Number 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.
      • setMaxReplicas

        public void setMaxReplicas​(@NonNull
                                   @NonNull java.lang.Number maxReplicas)
        maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.
      • setMetrics

        public void setMetrics​(java.util.List<MetricSpec> metrics)
        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.
      • setMinReplicas

        public void setMinReplicas​(java.lang.Number minReplicas)
        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.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object