HorizontalPodAutoscaler status
This commit is contained in:
@@ -31,6 +31,7 @@ package expapi
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/util"
|
||||
)
|
||||
|
||||
// ScaleSpec describes the attributes a Scale subresource
|
||||
@@ -74,8 +75,8 @@ type SubresourceReference struct {
|
||||
Subresource string `json:"subresource,omitempty"`
|
||||
}
|
||||
|
||||
// TargetConsumption is an object for specifying target average resource consumption of a particular resource.
|
||||
type TargetConsumption struct {
|
||||
// ResourceConsumption is an object for specifying average resource consumption of a particular resource.
|
||||
type ResourceConsumption struct {
|
||||
Resource api.ResourceName `json:"resource,omitempty"`
|
||||
Quantity resource.Quantity `json:"quantity,omitempty"`
|
||||
}
|
||||
@@ -91,7 +92,27 @@ type HorizontalPodAutoscalerSpec struct {
|
||||
MaxCount int `json:"maxCount"`
|
||||
// Target is the target average consumption of the given resource that the autoscaler will try to maintain by adjusting the desired number of pods.
|
||||
// Currently two types of resources are supported: "cpu" and "memory".
|
||||
Target TargetConsumption `json:"target"`
|
||||
Target ResourceConsumption `json:"target"`
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscalerStatus contains the current status of a horizontal pod autoscaler
|
||||
type HorizontalPodAutoscalerStatus struct {
|
||||
// CurrentReplicas is the number of replicas of pods managed by this autoscaler.
|
||||
CurrentReplicas int `json:"replicas"`
|
||||
|
||||
// DesiredReplicas is the desired number of replicas of pods managed by this autoscaler.
|
||||
// The number may be different because pod downscaling is someteimes delayed to keep the number
|
||||
// of pods stable.
|
||||
DesiredReplicas int `json:"replicas"`
|
||||
|
||||
// CurrentConsumption is the current average consumption of the given resource that the autoscaler will
|
||||
// try to maintain by adjusting the desired number of pods.
|
||||
// Two types of resources are supported: "cpu" and "memory".
|
||||
CurrentConsumption ResourceConsumption `json:"currentConsumption"`
|
||||
|
||||
// LastScaleTimestamp is the last time the HorizontalPodAutoscaler scaled the number of pods.
|
||||
// This is used by the autoscaler to controll how often the number of pods is changed.
|
||||
LastScaleTimestamp *util.Time `json:"lastScaleTimestamp,omitempty"`
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscaler represents the configuration of a horizontal pod autoscaler.
|
||||
@@ -101,6 +122,9 @@ type HorizontalPodAutoscaler struct {
|
||||
|
||||
// Spec defines the behaviour of autoscaler.
|
||||
Spec HorizontalPodAutoscalerSpec `json:"spec,omitempty"`
|
||||
|
||||
// Status represents the current information about the autoscaler.
|
||||
Status HorizontalPodAutoscalerStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// HorizontalPodAutoscaler is a collection of pod autoscalers.
|
||||
|
Reference in New Issue
Block a user