2 Copyright The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
18 // This file was autogenerated by go-to-protobuf. Do not edit it manually!
22 package k8s.io.api.autoscaling.v2beta2;
24 import "k8s.io/api/core/v1/generated.proto";
25 import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
26 import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
27 import "k8s.io/apimachinery/pkg/runtime/generated.proto";
28 import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
30 // Package-wide variables from generator "generated".
31 option go_package = "v2beta2";
33 // CrossVersionObjectReference contains enough information to let you identify the referred resource.
34 message CrossVersionObjectReference {
35 // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
36 optional string kind = 1;
38 // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
39 optional string name = 2;
41 // API version of the referent
43 optional string apiVersion = 3;
46 // ExternalMetricSource indicates how to scale on a metric not associated with
47 // any Kubernetes object (for example length of queue in cloud
48 // messaging service, or QPS from loadbalancer running outside of cluster).
49 message ExternalMetricSource {
50 // metric identifies the target metric by name and selector
51 optional MetricIdentifier metric = 1;
53 // target specifies the target value for the given metric
54 optional MetricTarget target = 2;
57 // ExternalMetricStatus indicates the current value of a global metric
58 // not associated with any Kubernetes object.
59 message ExternalMetricStatus {
60 // metric identifies the target metric by name and selector
61 optional MetricIdentifier metric = 1;
63 // current contains the current value for the given metric
64 optional MetricValueStatus current = 2;
67 // HorizontalPodAutoscaler is the configuration for a horizontal pod
68 // autoscaler, which automatically manages the replica count of any resource
69 // implementing the scale subresource based on the metrics specified.
70 message HorizontalPodAutoscaler {
71 // metadata is the standard object metadata.
72 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
74 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
76 // spec is the specification for the behaviour of the autoscaler.
77 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
79 optional HorizontalPodAutoscalerSpec spec = 2;
81 // status is the current information about the autoscaler.
83 optional HorizontalPodAutoscalerStatus status = 3;
86 // HorizontalPodAutoscalerCondition describes the state of
87 // a HorizontalPodAutoscaler at a certain point.
88 message HorizontalPodAutoscalerCondition {
89 // type describes the current condition
90 optional string type = 1;
92 // status is the status of the condition (True, False, Unknown)
93 optional string status = 2;
95 // lastTransitionTime is the last time the condition transitioned from
96 // one status to another
98 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
100 // reason is the reason for the condition's last transition.
102 optional string reason = 4;
104 // message is a human-readable explanation containing details about
107 optional string message = 5;
110 // HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
111 message HorizontalPodAutoscalerList {
112 // metadata is the standard list metadata.
114 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
116 // items is the list of horizontal pod autoscaler objects.
117 repeated HorizontalPodAutoscaler items = 2;
120 // HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
121 message HorizontalPodAutoscalerSpec {
122 // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
123 // should be collected, as well as to actually change the replica count.
124 optional CrossVersionObjectReference scaleTargetRef = 1;
126 // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
127 // It defaults to 1 pod.
129 optional int32 minReplicas = 2;
131 // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
132 // It cannot be less that minReplicas.
133 optional int32 maxReplicas = 3;
135 // metrics contains the specifications for which to use to calculate the
136 // desired replica count (the maximum replica count across all metrics will
137 // be used). The desired replica count is calculated multiplying the
138 // ratio between the target value and the current value by the current
139 // number of pods. Ergo, metrics used must decrease as the pod count is
140 // increased, and vice-versa. See the individual metric source types for
141 // more information about how each type of metric must respond.
142 // If not set, the default metric will be set to 80% average CPU utilization.
144 repeated MetricSpec metrics = 4;
147 // HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
148 message HorizontalPodAutoscalerStatus {
149 // observedGeneration is the most recent generation observed by this autoscaler.
151 optional int64 observedGeneration = 1;
153 // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
154 // used by the autoscaler to control how often the number of pods is changed.
156 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
158 // currentReplicas is current number of replicas of pods managed by this autoscaler,
159 // as last seen by the autoscaler.
160 optional int32 currentReplicas = 3;
162 // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
163 // as last calculated by the autoscaler.
164 optional int32 desiredReplicas = 4;
166 // currentMetrics is the last read state of the metrics used by this autoscaler.
168 repeated MetricStatus currentMetrics = 5;
170 // conditions is the set of conditions required for this autoscaler to scale its target,
171 // and indicates whether or not those conditions are met.
172 repeated HorizontalPodAutoscalerCondition conditions = 6;
175 // MetricIdentifier defines the name and optionally selector for a metric
176 message MetricIdentifier {
177 // name is the name of the given metric
178 optional string name = 1;
180 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
181 // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
182 // When unset, just the metricName will be used to gather metrics.
184 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
187 // MetricSpec specifies how to scale based on a single metric
188 // (only `type` and one other matching field should be set at once).
190 // type is the type of metric source. It should be one of "Object",
191 // "Pods" or "Resource", each mapping to a matching field in the object.
192 optional string type = 1;
194 // object refers to a metric describing a single kubernetes object
195 // (for example, hits-per-second on an Ingress object).
197 optional ObjectMetricSource object = 2;
199 // pods refers to a metric describing each pod in the current scale target
200 // (for example, transactions-processed-per-second). The values will be
201 // averaged together before being compared to the target value.
203 optional PodsMetricSource pods = 3;
205 // resource refers to a resource metric (such as those specified in
206 // requests and limits) known to Kubernetes describing each pod in the
207 // current scale target (e.g. CPU or memory). Such metrics are built in to
208 // Kubernetes, and have special scaling options on top of those available
209 // to normal per-pod metrics using the "pods" source.
211 optional ResourceMetricSource resource = 4;
213 // external refers to a global metric that is not associated
214 // with any Kubernetes object. It allows autoscaling based on information
215 // coming from components running outside of cluster
216 // (for example length of queue in cloud messaging service, or
217 // QPS from loadbalancer running outside of cluster).
219 optional ExternalMetricSource external = 5;
222 // MetricStatus describes the last-read state of a single metric.
223 message MetricStatus {
224 // type is the type of metric source. It will be one of "Object",
225 // "Pods" or "Resource", each corresponds to a matching field in the object.
226 optional string type = 1;
228 // object refers to a metric describing a single kubernetes object
229 // (for example, hits-per-second on an Ingress object).
231 optional ObjectMetricStatus object = 2;
233 // pods refers to a metric describing each pod in the current scale target
234 // (for example, transactions-processed-per-second). The values will be
235 // averaged together before being compared to the target value.
237 optional PodsMetricStatus pods = 3;
239 // resource refers to a resource metric (such as those specified in
240 // requests and limits) known to Kubernetes describing each pod in the
241 // current scale target (e.g. CPU or memory). Such metrics are built in to
242 // Kubernetes, and have special scaling options on top of those available
243 // to normal per-pod metrics using the "pods" source.
245 optional ResourceMetricStatus resource = 4;
247 // external refers to a global metric that is not associated
248 // with any Kubernetes object. It allows autoscaling based on information
249 // coming from components running outside of cluster
250 // (for example length of queue in cloud messaging service, or
251 // QPS from loadbalancer running outside of cluster).
253 optional ExternalMetricStatus external = 5;
256 // MetricTarget defines the target value, average value, or average utilization of a specific metric
257 message MetricTarget {
258 // type represents whether the metric type is Utilization, Value, or AverageValue
259 optional string type = 1;
261 // value is the target value of the metric (as a quantity).
263 optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 2;
265 // averageValue is the target value of the average of the
266 // metric across all relevant pods (as a quantity)
268 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3;
270 // averageUtilization is the target value of the average of the
271 // resource metric across all relevant pods, represented as a percentage of
272 // the requested value of the resource for the pods.
273 // Currently only valid for Resource metric source type
275 optional int32 averageUtilization = 4;
278 // MetricValueStatus holds the current value for a metric
279 message MetricValueStatus {
280 // value is the current value of the metric (as a quantity).
282 optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
284 // averageValue is the current value of the average of the
285 // metric across all relevant pods (as a quantity)
287 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2;
289 // currentAverageUtilization is the current value of the average of the
290 // resource metric across all relevant pods, represented as a percentage of
291 // the requested value of the resource for the pods.
293 optional int32 averageUtilization = 3;
296 // ObjectMetricSource indicates how to scale on a metric describing a
297 // kubernetes object (for example, hits-per-second on an Ingress object).
298 message ObjectMetricSource {
299 optional CrossVersionObjectReference describedObject = 1;
301 // target specifies the target value for the given metric
302 optional MetricTarget target = 2;
304 // metric identifies the target metric by name and selector
305 optional MetricIdentifier metric = 3;
308 // ObjectMetricStatus indicates the current value of a metric describing a
309 // kubernetes object (for example, hits-per-second on an Ingress object).
310 message ObjectMetricStatus {
311 // metric identifies the target metric by name and selector
312 optional MetricIdentifier metric = 1;
314 // current contains the current value for the given metric
315 optional MetricValueStatus current = 2;
317 optional CrossVersionObjectReference describedObject = 3;
320 // PodsMetricSource indicates how to scale on a metric describing each pod in
321 // the current scale target (for example, transactions-processed-per-second).
322 // The values will be averaged together before being compared to the target
324 message PodsMetricSource {
325 // metric identifies the target metric by name and selector
326 optional MetricIdentifier metric = 1;
328 // target specifies the target value for the given metric
329 optional MetricTarget target = 2;
332 // PodsMetricStatus indicates the current value of a metric describing each pod in
333 // the current scale target (for example, transactions-processed-per-second).
334 message PodsMetricStatus {
335 // metric identifies the target metric by name and selector
336 optional MetricIdentifier metric = 1;
338 // current contains the current value for the given metric
339 optional MetricValueStatus current = 2;
342 // ResourceMetricSource indicates how to scale on a resource metric known to
343 // Kubernetes, as specified in requests and limits, describing each pod in the
344 // current scale target (e.g. CPU or memory). The values will be averaged
345 // together before being compared to the target. Such metrics are built in to
346 // Kubernetes, and have special scaling options on top of those available to
347 // normal per-pod metrics using the "pods" source. Only one "target" type
349 message ResourceMetricSource {
350 // name is the name of the resource in question.
351 optional string name = 1;
353 // target specifies the target value for the given metric
354 optional MetricTarget target = 2;
357 // ResourceMetricStatus indicates the current value of a resource metric known to
358 // Kubernetes, as specified in requests and limits, describing each pod in the
359 // current scale target (e.g. CPU or memory). Such metrics are built in to
360 // Kubernetes, and have special scaling options on top of those available to
361 // normal per-pod metrics using the "pods" source.
362 message ResourceMetricStatus {
363 // Name is the name of the resource in question.
364 optional string name = 1;
366 // current contains the current value for the given metric
367 optional MetricValueStatus current = 2;