mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
HPA annotation structs for Custom Metrics
This commit is contained in:
parent
a81fa2f926
commit
23e74368b9
File diff suppressed because it is too large
Load Diff
@ -30,6 +30,7 @@ package extensions
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
)
|
||||
@ -87,6 +88,29 @@ type CPUTargetUtilization struct {
|
||||
TargetPercentage int `json:"targetPercentage"`
|
||||
}
|
||||
|
||||
// Alpha-level support for Custom Metrics in HPA (as annotations).
|
||||
type CustomMetricTarget struct {
|
||||
// Custom Metric name.
|
||||
Name string `json:"name"`
|
||||
// Custom Metric value (average).
|
||||
TargetValue resource.Quantity `json:"value"`
|
||||
}
|
||||
|
||||
type CustomMetricTargetList struct {
|
||||
Items []CustomMetricTarget `json:"items"`
|
||||
}
|
||||
|
||||
type CustomMetricCurrentStatus struct {
|
||||
// Custom Metric name.
|
||||
Name string `json:"name"`
|
||||
// Custom Metric value (average).
|
||||
CurrentValue resource.Quantity `json:"value"`
|
||||
}
|
||||
|
||||
type CustomMetricCurrentStatusList struct {
|
||||
Items []CustomMetricCurrentStatus `json:"items"`
|
||||
}
|
||||
|
||||
// specification of a horizontal pod autoscaler.
|
||||
type HorizontalPodAutoscalerSpec struct {
|
||||
// reference to Scale subresource; horizontal pod autoscaler will learn the current resource consumption from its status,
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/util/intstr"
|
||||
@ -73,6 +74,29 @@ type CPUTargetUtilization struct {
|
||||
TargetPercentage int32 `json:"targetPercentage"`
|
||||
}
|
||||
|
||||
// Alpha-level support for Custom Metrics in HPA (as annotations).
|
||||
type CustomMetricTarget struct {
|
||||
// Custom Metric name.
|
||||
Name string `json:"name"`
|
||||
// Custom Metric value (average).
|
||||
TargetValue resource.Quantity `json:"value"`
|
||||
}
|
||||
|
||||
type CustomMetricTargetList struct {
|
||||
Items []CustomMetricTarget `json:"items"`
|
||||
}
|
||||
|
||||
type CustomMetricCurrentStatus struct {
|
||||
// Custom Metric name.
|
||||
Name string `json:"name"`
|
||||
// Custom Metric value (average).
|
||||
CurrentValue resource.Quantity `json:"value"`
|
||||
}
|
||||
|
||||
type CustomMetricCurrentStatusList struct {
|
||||
Items []CustomMetricCurrentStatus `json:"items"`
|
||||
}
|
||||
|
||||
// specification of a horizontal pod autoscaler.
|
||||
type HorizontalPodAutoscalerSpec struct {
|
||||
// reference to Scale subresource; horizontal pod autoscaler will learn the current resource consumption from its status,
|
||||
|
@ -74,6 +74,25 @@ func (ClusterAutoscalerSpec) SwaggerDoc() map[string]string {
|
||||
return map_ClusterAutoscalerSpec
|
||||
}
|
||||
|
||||
var map_CustomMetricCurrentStatus = map[string]string{
|
||||
"name": "Custom Metric name.",
|
||||
"value": "Custom Metric value (average).",
|
||||
}
|
||||
|
||||
func (CustomMetricCurrentStatus) SwaggerDoc() map[string]string {
|
||||
return map_CustomMetricCurrentStatus
|
||||
}
|
||||
|
||||
var map_CustomMetricTarget = map[string]string{
|
||||
"": "Alpha-level support for Custom Metrics in HPA (as annotations).",
|
||||
"name": "Custom Metric name.",
|
||||
"value": "Custom Metric value (average).",
|
||||
}
|
||||
|
||||
func (CustomMetricTarget) SwaggerDoc() map[string]string {
|
||||
return map_CustomMetricTarget
|
||||
}
|
||||
|
||||
var map_DaemonSet = map[string]string{
|
||||
"": "DaemonSet represents the configuration of a daemon set.",
|
||||
"metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
|
||||
|
Loading…
Reference in New Issue
Block a user