HorizontalPodAutoscaler API: removal of ResourceConsumption target, introduction of CPU request utilization & other cleanups.

This commit is contained in:
Jerzy Szczepkowski
2015-10-13 17:24:23 +02:00
committed by Filip Grzadkowski
parent 3e5f792f69
commit df732f061a
19 changed files with 625 additions and 598 deletions

View File

@@ -1250,17 +1250,14 @@ func (d *HorizontalPodAutoscalerDescriber) Describe(namespace, name string) (str
hpa.Spec.ScaleRef.Namespace,
hpa.Spec.ScaleRef.Name,
hpa.Spec.ScaleRef.Subresource)
fmt.Fprintf(out, "Target resource consumption:\t%s %s\n",
hpa.Spec.Target.Quantity.String(),
hpa.Spec.Target.Resource)
fmt.Fprintf(out, "Current resource consumption:\t")
if hpa.Status.CurrentConsumption != nil {
fmt.Fprintf(out, "%s %s\n",
hpa.Status.CurrentConsumption.Quantity.String(),
hpa.Status.CurrentConsumption.Resource)
} else {
fmt.Fprintf(out, "<not available>\n")
if hpa.Spec.CPUUtilization != nil {
fmt.Fprintf(out, "Target CPU utilization:\t%d%%\n", hpa.Spec.CPUUtilization.TargetPercentage)
fmt.Fprintf(out, "Current CPU utilization:\t")
if hpa.Status.CurrentCPUUtilizationPercentage != nil {
fmt.Fprintf(out, "%d%%\n", *hpa.Status.CurrentCPUUtilizationPercentage)
} else {
fmt.Fprintf(out, "<not available>\n")
}
}
fmt.Fprintf(out, "Min pods:\t%d\n", hpa.Spec.MinReplicas)
fmt.Fprintf(out, "Max pods:\t%d\n", hpa.Spec.MaxReplicas)