forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#36033 from DirectXMan12/feature/hpa-v2
Automatic merge from submit-queue (batch tested with PRs 40796, 40878, 36033, 40838, 41210) HPA v2 (API Changes) **Release note**: ```release-note Introduces an new alpha version of the Horizontal Pod Autoscaler including expanded support for specifying metrics. ``` Implements the API changes for kubernetes/enhancements#117. This implements kubernetes#34754, which is the new design for the Horizontal Pod Autoscaler. It includes improved support for custom metrics (and/or arbitrary metrics) as well as expanded support for resource metrics. The new HPA object is introduces in the API group "autoscaling/v1alpha1". Note that the improved custom metric support currently is limited to per pod metrics from Heapster -- attempting to use the new "object metrics" will simply result in an error. This will change once kubernetes#34586 is merged and implemented.
- Loading branch information
Showing
77 changed files
with
20,402 additions
and
510 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"swaggerVersion": "1.2", | ||
"apiVersion": "autoscaling/v2alpha1", | ||
"basePath": "https://10.10.10.10:6443", | ||
"resourcePath": "/apis/autoscaling/v2alpha1", | ||
"info": { | ||
"title": "", | ||
"description": "" | ||
}, | ||
"apis": [ | ||
{ | ||
"path": "/apis/autoscaling/v2alpha1", | ||
"description": "API at /apis/autoscaling/v2alpha1", | ||
"operations": [ | ||
{ | ||
"type": "v1.APIResourceList", | ||
"method": "GET", | ||
"summary": "get available resources", | ||
"nickname": "getAPIResources", | ||
"parameters": [], | ||
"produces": [ | ||
"application/json", | ||
"application/yaml", | ||
"application/vnd.kubernetes.protobuf" | ||
], | ||
"consumes": [ | ||
"application/json", | ||
"application/yaml", | ||
"application/vnd.kubernetes.protobuf" | ||
] | ||
} | ||
] | ||
} | ||
], | ||
"models": { | ||
"v1.APIResourceList": { | ||
"id": "v1.APIResourceList", | ||
"description": "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", | ||
"required": [ | ||
"groupVersion", | ||
"resources" | ||
], | ||
"properties": { | ||
"kind": { | ||
"type": "string", | ||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds" | ||
}, | ||
"apiVersion": { | ||
"type": "string", | ||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources" | ||
}, | ||
"groupVersion": { | ||
"type": "string", | ||
"description": "groupVersion is the group and version this APIResourceList is for." | ||
}, | ||
"resources": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "v1.APIResource" | ||
}, | ||
"description": "resources contains the name of the resources and if they are namespaced." | ||
} | ||
} | ||
}, | ||
"v1.APIResource": { | ||
"id": "v1.APIResource", | ||
"description": "APIResource specifies the name of a resource and whether it is namespaced.", | ||
"required": [ | ||
"name", | ||
"namespaced", | ||
"kind", | ||
"verbs" | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "name is the name of the resource." | ||
}, | ||
"namespaced": { | ||
"type": "boolean", | ||
"description": "namespaced indicates if a resource is namespaced or not." | ||
}, | ||
"kind": { | ||
"type": "string", | ||
"description": "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')" | ||
}, | ||
"verbs": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)" | ||
}, | ||
"shortNames": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "shortNames is a list of suggested short names of the resource." | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
508 changes: 508 additions & 0 deletions
508
docs/api-reference/autoscaling/v2alpha1/definitions.html
Large diffs are not rendered by default.
Oops, something went wrong.
454 changes: 454 additions & 0 deletions
454
docs/api-reference/autoscaling/v2alpha1/operations.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Copyright 2016 The Kubernetes Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package autoscaling | ||
|
||
// MetricSpecsAnnotation is the annotation which holds non-CPU-utilization HPA metric | ||
// specs when converting the `Metrics` field from autoscaling/v2alpha1 | ||
const MetricSpecsAnnotation = "autoscaling.alpha.kubernetes.io/metrics" | ||
|
||
// MetricStatusesAnnotation is the annotation which holds non-CPU-utilization HPA metric | ||
// statuses when converting the `CurrentMetrics` field from autoscaling/v2alpha1 | ||
const MetricStatusesAnnotation = "autoscaling.alpha.kubernetes.io/current-metrics" | ||
|
||
// DefaultCPUUtilization is the default value for CPU utilization, provided no other | ||
// metrics are present. This is here because it's used by both the v2alpha1 defaulting | ||
// logic, and the pseudo-defaulting done in v1 conversion. | ||
const DefaultCPUUtilization = 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.