mirror of https://github.com/k3s-io/k3s
kubectl get hpa should how current replicas
parent
24b3f6c494
commit
b8311ec7f9
|
@ -507,7 +507,7 @@ var (
|
|||
|
||||
// TODO: consider having 'KIND' for third party resource data
|
||||
thirdPartyResourceDataColumns = []string{"NAME", "LABELS", "DATA"}
|
||||
horizontalPodAutoscalerColumns = []string{"NAME", "REFERENCE", "TARGET", "CURRENT", "MINPODS", "MAXPODS", "AGE"}
|
||||
horizontalPodAutoscalerColumns = []string{"NAME", "REFERENCE", "TARGET", "CURRENT", "MINPODS", "MAXPODS", "REPLICAS", "AGE"}
|
||||
withNamespacePrefixColumns = []string{"NAMESPACE"} // TODO(erictune): print cluster name too.
|
||||
deploymentColumns = []string{"NAME", "DESIRED", "CURRENT", "UP-TO-DATE", "AVAILABLE", "AGE"}
|
||||
configMapColumns = []string{"NAME", "DATA", "AGE"}
|
||||
|
@ -2114,6 +2114,7 @@ func printHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, w io
|
|||
minPods = fmt.Sprintf("%d", *hpa.Spec.MinReplicas)
|
||||
}
|
||||
maxPods := hpa.Spec.MaxReplicas
|
||||
currentReplicas := hpa.Status.CurrentReplicas
|
||||
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
|
@ -2121,13 +2122,14 @@ func printHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, w io
|
|||
}
|
||||
}
|
||||
|
||||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%d\t%s",
|
||||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%d\t%d\t%s",
|
||||
name,
|
||||
reference,
|
||||
target,
|
||||
current,
|
||||
minPods,
|
||||
maxPods,
|
||||
currentReplicas,
|
||||
translateTimestamp(hpa.CreationTimestamp),
|
||||
); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue