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.v2beta1;
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 = "v2beta1";
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 // Exactly one "target" type should be set.
50 message ExternalMetricSource {
51 // metricName is the name of the metric in question.
52 optional string metricName = 1;
54 // metricSelector is used to identify a specific time series
55 // within a given metric.
57 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
59 // targetValue is the target value of the metric (as a quantity).
60 // Mutually exclusive with TargetAverageValue.
62 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
64 // targetAverageValue is the target per-pod value of global metric (as a quantity).
65 // Mutually exclusive with TargetValue.
67 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
70 // ExternalMetricStatus indicates the current value of a global metric
71 // not associated with any Kubernetes object.
72 message ExternalMetricStatus {
73 // metricName is the name of a metric used for autoscaling in
75 optional string metricName = 1;
77 // metricSelector is used to identify a specific time series
78 // within a given metric.
80 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
82 // currentValue is the current value of the metric (as a quantity)
83 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
85 // currentAverageValue is the current value of metric averaged over autoscaled pods.
87 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
90 // HorizontalPodAutoscaler is the configuration for a horizontal pod
91 // autoscaler, which automatically manages the replica count of any resource
92 // implementing the scale subresource based on the metrics specified.
93 message HorizontalPodAutoscaler {
94 // metadata is the standard object metadata.
95 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
97 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
99 // spec is the specification for the behaviour of the autoscaler.
100 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
102 optional HorizontalPodAutoscalerSpec spec = 2;
104 // status is the current information about the autoscaler.
106 optional HorizontalPodAutoscalerStatus status = 3;
109 // HorizontalPodAutoscalerCondition describes the state of
110 // a HorizontalPodAutoscaler at a certain point.
111 message HorizontalPodAutoscalerCondition {
112 // type describes the current condition
113 optional string type = 1;
115 // status is the status of the condition (True, False, Unknown)
116 optional string status = 2;
118 // lastTransitionTime is the last time the condition transitioned from
119 // one status to another
121 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
123 // reason is the reason for the condition's last transition.
125 optional string reason = 4;
127 // message is a human-readable explanation containing details about
130 optional string message = 5;
133 // HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.
134 message HorizontalPodAutoscalerList {
135 // metadata is the standard list metadata.
137 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
139 // items is the list of horizontal pod autoscaler objects.
140 repeated HorizontalPodAutoscaler items = 2;
143 // HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
144 message HorizontalPodAutoscalerSpec {
145 // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
146 // should be collected, as well as to actually change the replica count.
147 optional CrossVersionObjectReference scaleTargetRef = 1;
149 // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
150 // It defaults to 1 pod.
152 optional int32 minReplicas = 2;
154 // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
155 // It cannot be less that minReplicas.
156 optional int32 maxReplicas = 3;
158 // metrics contains the specifications for which to use to calculate the
159 // desired replica count (the maximum replica count across all metrics will
160 // be used). The desired replica count is calculated multiplying the
161 // ratio between the target value and the current value by the current
162 // number of pods. Ergo, metrics used must decrease as the pod count is
163 // increased, and vice-versa. See the individual metric source types for
164 // more information about how each type of metric must respond.
166 repeated MetricSpec metrics = 4;
169 // HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
170 message HorizontalPodAutoscalerStatus {
171 // observedGeneration is the most recent generation observed by this autoscaler.
173 optional int64 observedGeneration = 1;
175 // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
176 // used by the autoscaler to control how often the number of pods is changed.
178 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
180 // currentReplicas is current number of replicas of pods managed by this autoscaler,
181 // as last seen by the autoscaler.
182 optional int32 currentReplicas = 3;
184 // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
185 // as last calculated by the autoscaler.
186 optional int32 desiredReplicas = 4;
188 // currentMetrics is the last read state of the metrics used by this autoscaler.
190 repeated MetricStatus currentMetrics = 5;
192 // conditions is the set of conditions required for this autoscaler to scale its target,
193 // and indicates whether or not those conditions are met.
194 repeated HorizontalPodAutoscalerCondition conditions = 6;
197 // MetricSpec specifies how to scale based on a single metric
198 // (only `type` and one other matching field should be set at once).
200 // type is the type of metric source. It should be one of "Object",
201 // "Pods" or "Resource", each mapping to a matching field in the object.
202 optional string type = 1;
204 // object refers to a metric describing a single kubernetes object
205 // (for example, hits-per-second on an Ingress object).
207 optional ObjectMetricSource object = 2;
209 // pods refers to a metric describing each pod in the current scale target
210 // (for example, transactions-processed-per-second). The values will be
211 // averaged together before being compared to the target value.
213 optional PodsMetricSource pods = 3;
215 // resource refers to a resource metric (such as those specified in
216 // requests and limits) known to Kubernetes describing each pod in the
217 // current scale target (e.g. CPU or memory). Such metrics are built in to
218 // Kubernetes, and have special scaling options on top of those available
219 // to normal per-pod metrics using the "pods" source.
221 optional ResourceMetricSource resource = 4;
223 // external refers to a global metric that is not associated
224 // with any Kubernetes object. It allows autoscaling based on information
225 // coming from components running outside of cluster
226 // (for example length of queue in cloud messaging service, or
227 // QPS from loadbalancer running outside of cluster).
229 optional ExternalMetricSource external = 5;
232 // MetricStatus describes the last-read state of a single metric.
233 message MetricStatus {
234 // type is the type of metric source. It will be one of "Object",
235 // "Pods" or "Resource", each corresponds to a matching field in the object.
236 optional string type = 1;
238 // object refers to a metric describing a single kubernetes object
239 // (for example, hits-per-second on an Ingress object).
241 optional ObjectMetricStatus object = 2;
243 // pods refers to a metric describing each pod in the current scale target
244 // (for example, transactions-processed-per-second). The values will be
245 // averaged together before being compared to the target value.
247 optional PodsMetricStatus pods = 3;
249 // resource refers to a resource metric (such as those specified in
250 // requests and limits) known to Kubernetes describing each pod in the
251 // current scale target (e.g. CPU or memory). Such metrics are built in to
252 // Kubernetes, and have special scaling options on top of those available
253 // to normal per-pod metrics using the "pods" source.
255 optional ResourceMetricStatus resource = 4;
257 // external refers to a global metric that is not associated
258 // with any Kubernetes object. It allows autoscaling based on information
259 // coming from components running outside of cluster
260 // (for example length of queue in cloud messaging service, or
261 // QPS from loadbalancer running outside of cluster).
263 optional ExternalMetricStatus external = 5;
266 // ObjectMetricSource indicates how to scale on a metric describing a
267 // kubernetes object (for example, hits-per-second on an Ingress object).
268 message ObjectMetricSource {
269 // target is the described Kubernetes object.
270 optional CrossVersionObjectReference target = 1;
272 // metricName is the name of the metric in question.
273 optional string metricName = 2;
275 // targetValue is the target value of the metric (as a quantity).
276 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
278 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
279 // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
280 // When unset, just the metricName will be used to gather metrics.
282 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
284 // averageValue is the target 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 = 5;
290 // ObjectMetricStatus indicates the current value of a metric describing a
291 // kubernetes object (for example, hits-per-second on an Ingress object).
292 message ObjectMetricStatus {
293 // target is the described Kubernetes object.
294 optional CrossVersionObjectReference target = 1;
296 // metricName is the name of the metric in question.
297 optional string metricName = 2;
299 // currentValue is the current value of the metric (as a quantity).
300 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
302 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
303 // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
304 // When unset, just the metricName will be used to gather metrics.
306 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
308 // averageValue is the current value of the average of the
309 // metric across all relevant pods (as a quantity)
311 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
314 // PodsMetricSource indicates how to scale on a metric describing each pod in
315 // the current scale target (for example, transactions-processed-per-second).
316 // The values will be averaged together before being compared to the target
318 message PodsMetricSource {
319 // metricName is the name of the metric in question
320 optional string metricName = 1;
322 // targetAverageValue is the target value of the average of the
323 // metric across all relevant pods (as a quantity)
324 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
326 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
327 // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
328 // When unset, just the metricName will be used to gather metrics.
330 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
333 // PodsMetricStatus indicates the current value of a metric describing each pod in
334 // the current scale target (for example, transactions-processed-per-second).
335 message PodsMetricStatus {
336 // metricName is the name of the metric in question
337 optional string metricName = 1;
339 // currentAverageValue is the current value of the average of the
340 // metric across all relevant pods (as a quantity)
341 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
343 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
344 // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
345 // When unset, just the metricName will be used to gather metrics.
347 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
350 // ResourceMetricSource indicates how to scale on a resource metric known to
351 // Kubernetes, as specified in requests and limits, describing each pod in the
352 // current scale target (e.g. CPU or memory). The values will be averaged
353 // together before being compared to the target. Such metrics are built in to
354 // Kubernetes, and have special scaling options on top of those available to
355 // normal per-pod metrics using the "pods" source. Only one "target" type
357 message ResourceMetricSource {
358 // name is the name of the resource in question.
359 optional string name = 1;
361 // targetAverageUtilization is the target value of the average of the
362 // resource metric across all relevant pods, represented as a percentage of
363 // the requested value of the resource for the pods.
365 optional int32 targetAverageUtilization = 2;
367 // targetAverageValue is the target value of the average of the
368 // resource metric across all relevant pods, as a raw value (instead of as
369 // a percentage of the request), similar to the "pods" metric source type.
371 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
374 // ResourceMetricStatus indicates the current value of a resource metric known to
375 // Kubernetes, as specified in requests and limits, describing each pod in the
376 // current scale target (e.g. CPU or memory). Such metrics are built in to
377 // Kubernetes, and have special scaling options on top of those available to
378 // normal per-pod metrics using the "pods" source.
379 message ResourceMetricStatus {
380 // name is the name of the resource in question.
381 optional string name = 1;
383 // currentAverageUtilization is the current value of the average of the
384 // resource metric across all relevant pods, represented as a percentage of
385 // the requested value of the resource for the pods. It will only be
386 // present if `targetAverageValue` was set in the corresponding metric
389 optional int32 currentAverageUtilization = 2;
391 // currentAverageValue is the current value of the average of the
392 // resource metric across all relevant pods, as a raw value (instead of as
393 // a percentage of the request), similar to the "pods" metric source type.
394 // It will always be set, regardless of the corresponding metric specification.
395 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;