1/*
2Copyright The Kubernetes Authors.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17
18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
19
20syntax = "proto2";
21
22package k8s.io.api.autoscaling.v2beta1;
23
24import "k8s.io/api/core/v1/generated.proto";
25import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
26import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
27import "k8s.io/apimachinery/pkg/runtime/generated.proto";
28import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
29
30// Package-wide variables from generator "generated".
31option go_package = "k8s.io/api/autoscaling/v2beta1";
32
33// ContainerResourceMetricSource indicates how to scale on a resource metric known to
34// Kubernetes, as specified in requests and limits, describing each pod in the
35// current scale target (e.g. CPU or memory). The values will be averaged
36// together before being compared to the target. Such metrics are built in to
37// Kubernetes, and have special scaling options on top of those available to
38// normal per-pod metrics using the "pods" source. Only one "target" type
39// should be set.
40message ContainerResourceMetricSource {
41 // name is the name of the resource in question.
42 optional string name = 1;
43
44 // targetAverageUtilization is the target value of the average of the
45 // resource metric across all relevant pods, represented as a percentage of
46 // the requested value of the resource for the pods.
47 // +optional
48 optional int32 targetAverageUtilization = 2;
49
50 // targetAverageValue is the target value of the average of the
51 // resource metric across all relevant pods, as a raw value (instead of as
52 // a percentage of the request), similar to the "pods" metric source type.
53 // +optional
54 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
55
56 // container is the name of the container in the pods of the scaling target
57 optional string container = 4;
58}
59
60// ContainerResourceMetricStatus indicates the current value of a resource metric known to
61// Kubernetes, as specified in requests and limits, describing a single container in each pod in the
62// current scale target (e.g. CPU or memory). Such metrics are built in to
63// Kubernetes, and have special scaling options on top of those available to
64// normal per-pod metrics using the "pods" source.
65message ContainerResourceMetricStatus {
66 // name is the name of the resource in question.
67 optional string name = 1;
68
69 // currentAverageUtilization is the current value of the average of the
70 // resource metric across all relevant pods, represented as a percentage of
71 // the requested value of the resource for the pods. It will only be
72 // present if `targetAverageValue` was set in the corresponding metric
73 // specification.
74 // +optional
75 optional int32 currentAverageUtilization = 2;
76
77 // currentAverageValue is the current value of the average of the
78 // resource metric across all relevant pods, as a raw value (instead of as
79 // a percentage of the request), similar to the "pods" metric source type.
80 // It will always be set, regardless of the corresponding metric specification.
81 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
82
83 // container is the name of the container in the pods of the scaling target
84 optional string container = 4;
85}
86
87// CrossVersionObjectReference contains enough information to let you identify the referred resource.
88message CrossVersionObjectReference {
89 // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
90 optional string kind = 1;
91
92 // Name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
93 optional string name = 2;
94
95 // API version of the referent
96 // +optional
97 optional string apiVersion = 3;
98}
99
100// ExternalMetricSource indicates how to scale on a metric not associated with
101// any Kubernetes object (for example length of queue in cloud
102// messaging service, or QPS from loadbalancer running outside of cluster).
103// Exactly one "target" type should be set.
104message ExternalMetricSource {
105 // metricName is the name of the metric in question.
106 optional string metricName = 1;
107
108 // metricSelector is used to identify a specific time series
109 // within a given metric.
110 // +optional
111 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
112
113 // targetValue is the target value of the metric (as a quantity).
114 // Mutually exclusive with TargetAverageValue.
115 // +optional
116 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
117
118 // targetAverageValue is the target per-pod value of global metric (as a quantity).
119 // Mutually exclusive with TargetValue.
120 // +optional
121 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
122}
123
124// ExternalMetricStatus indicates the current value of a global metric
125// not associated with any Kubernetes object.
126message ExternalMetricStatus {
127 // metricName is the name of a metric used for autoscaling in
128 // metric system.
129 optional string metricName = 1;
130
131 // metricSelector is used to identify a specific time series
132 // within a given metric.
133 // +optional
134 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
135
136 // currentValue is the current value of the metric (as a quantity)
137 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
138
139 // currentAverageValue is the current value of metric averaged over autoscaled pods.
140 // +optional
141 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
142}
143
144// HorizontalPodAutoscaler is the configuration for a horizontal pod
145// autoscaler, which automatically manages the replica count of any resource
146// implementing the scale subresource based on the metrics specified.
147message HorizontalPodAutoscaler {
148 // metadata is the standard object metadata.
149 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
150 // +optional
151 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
152
153 // spec is the specification for the behaviour of the autoscaler.
154 // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
155 // +optional
156 optional HorizontalPodAutoscalerSpec spec = 2;
157
158 // status is the current information about the autoscaler.
159 // +optional
160 optional HorizontalPodAutoscalerStatus status = 3;
161}
162
163// HorizontalPodAutoscalerCondition describes the state of
164// a HorizontalPodAutoscaler at a certain point.
165message HorizontalPodAutoscalerCondition {
166 // type describes the current condition
167 optional string type = 1;
168
169 // status is the status of the condition (True, False, Unknown)
170 optional string status = 2;
171
172 // lastTransitionTime is the last time the condition transitioned from
173 // one status to another
174 // +optional
175 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
176
177 // reason is the reason for the condition's last transition.
178 // +optional
179 optional string reason = 4;
180
181 // message is a human-readable explanation containing details about
182 // the transition
183 // +optional
184 optional string message = 5;
185}
186
187// HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.
188message HorizontalPodAutoscalerList {
189 // metadata is the standard list metadata.
190 // +optional
191 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
192
193 // items is the list of horizontal pod autoscaler objects.
194 repeated HorizontalPodAutoscaler items = 2;
195}
196
197// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
198message HorizontalPodAutoscalerSpec {
199 // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
200 // should be collected, as well as to actually change the replica count.
201 optional CrossVersionObjectReference scaleTargetRef = 1;
202
203 // minReplicas is the lower limit for the number of replicas to which the autoscaler
204 // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
205 // alpha feature gate HPAScaleToZero is enabled and at least one Object or External
206 // metric is configured. Scaling is active as long as at least one metric value is
207 // available.
208 // +optional
209 optional int32 minReplicas = 2;
210
211 // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
212 // It cannot be less that minReplicas.
213 optional int32 maxReplicas = 3;
214
215 // metrics contains the specifications for which to use to calculate the
216 // desired replica count (the maximum replica count across all metrics will
217 // be used). The desired replica count is calculated multiplying the
218 // ratio between the target value and the current value by the current
219 // number of pods. Ergo, metrics used must decrease as the pod count is
220 // increased, and vice-versa. See the individual metric source types for
221 // more information about how each type of metric must respond.
222 // +optional
223 // +listType=atomic
224 repeated MetricSpec metrics = 4;
225}
226
227// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
228message HorizontalPodAutoscalerStatus {
229 // observedGeneration is the most recent generation observed by this autoscaler.
230 // +optional
231 optional int64 observedGeneration = 1;
232
233 // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
234 // used by the autoscaler to control how often the number of pods is changed.
235 // +optional
236 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
237
238 // currentReplicas is current number of replicas of pods managed by this autoscaler,
239 // as last seen by the autoscaler.
240 optional int32 currentReplicas = 3;
241
242 // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
243 // as last calculated by the autoscaler.
244 optional int32 desiredReplicas = 4;
245
246 // currentMetrics is the last read state of the metrics used by this autoscaler.
247 // +optional
248 // +listType=atomic
249 repeated MetricStatus currentMetrics = 5;
250
251 // conditions is the set of conditions required for this autoscaler to scale its target,
252 // and indicates whether or not those conditions are met.
253 // +optional
254 // +listType=atomic
255 repeated HorizontalPodAutoscalerCondition conditions = 6;
256}
257
258// MetricSpec specifies how to scale based on a single metric
259// (only `type` and one other matching field should be set at once).
260message MetricSpec {
261 // type is the type of metric source. It should be one of "ContainerResource",
262 // "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object.
263 // Note: "ContainerResource" type is available on when the feature-gate
264 // HPAContainerMetrics is enabled
265 optional string type = 1;
266
267 // object refers to a metric describing a single kubernetes object
268 // (for example, hits-per-second on an Ingress object).
269 // +optional
270 optional ObjectMetricSource object = 2;
271
272 // pods refers to a metric describing each pod in the current scale target
273 // (for example, transactions-processed-per-second). The values will be
274 // averaged together before being compared to the target value.
275 // +optional
276 optional PodsMetricSource pods = 3;
277
278 // resource refers to a resource metric (such as those specified in
279 // requests and limits) known to Kubernetes describing each pod in the
280 // current scale target (e.g. CPU or memory). Such metrics are built in to
281 // Kubernetes, and have special scaling options on top of those available
282 // to normal per-pod metrics using the "pods" source.
283 // +optional
284 optional ResourceMetricSource resource = 4;
285
286 // container resource refers to a resource metric (such as those specified in
287 // requests and limits) known to Kubernetes describing a single container in
288 // each pod of the current scale target (e.g. CPU or memory). Such metrics are
289 // built in to Kubernetes, and have special scaling options on top of those
290 // available to normal per-pod metrics using the "pods" source.
291 // This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
292 // +optional
293 optional ContainerResourceMetricSource containerResource = 7;
294
295 // external refers to a global metric that is not associated
296 // with any Kubernetes object. It allows autoscaling based on information
297 // coming from components running outside of cluster
298 // (for example length of queue in cloud messaging service, or
299 // QPS from loadbalancer running outside of cluster).
300 // +optional
301 optional ExternalMetricSource external = 5;
302}
303
304// MetricStatus describes the last-read state of a single metric.
305message MetricStatus {
306 // type is the type of metric source. It will be one of "ContainerResource",
307 // "External", "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
308 // Note: "ContainerResource" type is available on when the feature-gate
309 // HPAContainerMetrics is enabled
310 optional string type = 1;
311
312 // object refers to a metric describing a single kubernetes object
313 // (for example, hits-per-second on an Ingress object).
314 // +optional
315 optional ObjectMetricStatus object = 2;
316
317 // pods refers to a metric describing each pod in the current scale target
318 // (for example, transactions-processed-per-second). The values will be
319 // averaged together before being compared to the target value.
320 // +optional
321 optional PodsMetricStatus pods = 3;
322
323 // resource refers to a resource metric (such as those specified in
324 // requests and limits) known to Kubernetes describing each pod in the
325 // current scale target (e.g. CPU or memory). Such metrics are built in to
326 // Kubernetes, and have special scaling options on top of those available
327 // to normal per-pod metrics using the "pods" source.
328 // +optional
329 optional ResourceMetricStatus resource = 4;
330
331 // container resource refers to a resource metric (such as those specified in
332 // requests and limits) known to Kubernetes describing a single container in each pod in the
333 // current scale target (e.g. CPU or memory). Such metrics are built in to
334 // Kubernetes, and have special scaling options on top of those available
335 // to normal per-pod metrics using the "pods" source.
336 // +optional
337 optional ContainerResourceMetricStatus containerResource = 7;
338
339 // external refers to a global metric that is not associated
340 // with any Kubernetes object. It allows autoscaling based on information
341 // coming from components running outside of cluster
342 // (for example length of queue in cloud messaging service, or
343 // QPS from loadbalancer running outside of cluster).
344 // +optional
345 optional ExternalMetricStatus external = 5;
346}
347
348// ObjectMetricSource indicates how to scale on a metric describing a
349// kubernetes object (for example, hits-per-second on an Ingress object).
350message ObjectMetricSource {
351 // target is the described Kubernetes object.
352 optional CrossVersionObjectReference target = 1;
353
354 // metricName is the name of the metric in question.
355 optional string metricName = 2;
356
357 // targetValue is the target value of the metric (as a quantity).
358 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
359
360 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
361 // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
362 // When unset, just the metricName will be used to gather metrics.
363 // +optional
364 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
365
366 // averageValue is the target value of the average of the
367 // metric across all relevant pods (as a quantity)
368 // +optional
369 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
370}
371
372// ObjectMetricStatus indicates the current value of a metric describing a
373// kubernetes object (for example, hits-per-second on an Ingress object).
374message ObjectMetricStatus {
375 // target is the described Kubernetes object.
376 optional CrossVersionObjectReference target = 1;
377
378 // metricName is the name of the metric in question.
379 optional string metricName = 2;
380
381 // currentValue is the current value of the metric (as a quantity).
382 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
383
384 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
385 // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
386 // When unset, just the metricName will be used to gather metrics.
387 // +optional
388 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
389
390 // averageValue is the current value of the average of the
391 // metric across all relevant pods (as a quantity)
392 // +optional
393 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
394}
395
396// PodsMetricSource indicates how to scale on a metric describing each pod in
397// the current scale target (for example, transactions-processed-per-second).
398// The values will be averaged together before being compared to the target
399// value.
400message PodsMetricSource {
401 // metricName is the name of the metric in question
402 optional string metricName = 1;
403
404 // targetAverageValue is the target value of the average of the
405 // metric across all relevant pods (as a quantity)
406 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
407
408 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
409 // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
410 // When unset, just the metricName will be used to gather metrics.
411 // +optional
412 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
413}
414
415// PodsMetricStatus indicates the current value of a metric describing each pod in
416// the current scale target (for example, transactions-processed-per-second).
417message PodsMetricStatus {
418 // metricName is the name of the metric in question
419 optional string metricName = 1;
420
421 // currentAverageValue is the current value of the average of the
422 // metric across all relevant pods (as a quantity)
423 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
424
425 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
426 // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
427 // When unset, just the metricName will be used to gather metrics.
428 // +optional
429 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
430}
431
432// ResourceMetricSource indicates how to scale on a resource metric known to
433// Kubernetes, as specified in requests and limits, describing each pod in the
434// current scale target (e.g. CPU or memory). The values will be averaged
435// together before being compared to the target. Such metrics are built in to
436// Kubernetes, and have special scaling options on top of those available to
437// normal per-pod metrics using the "pods" source. Only one "target" type
438// should be set.
439message ResourceMetricSource {
440 // name is the name of the resource in question.
441 optional string name = 1;
442
443 // targetAverageUtilization is the target value of the average of the
444 // resource metric across all relevant pods, represented as a percentage of
445 // the requested value of the resource for the pods.
446 // +optional
447 optional int32 targetAverageUtilization = 2;
448
449 // targetAverageValue is the target value of the average of the
450 // resource metric across all relevant pods, as a raw value (instead of as
451 // a percentage of the request), similar to the "pods" metric source type.
452 // +optional
453 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
454}
455
456// ResourceMetricStatus indicates the current value of a resource metric known to
457// Kubernetes, as specified in requests and limits, describing each pod in the
458// current scale target (e.g. CPU or memory). Such metrics are built in to
459// Kubernetes, and have special scaling options on top of those available to
460// normal per-pod metrics using the "pods" source.
461message ResourceMetricStatus {
462 // name is the name of the resource in question.
463 optional string name = 1;
464
465 // currentAverageUtilization is the current value of the average of the
466 // resource metric across all relevant pods, represented as a percentage of
467 // the requested value of the resource for the pods. It will only be
468 // present if `targetAverageValue` was set in the corresponding metric
469 // specification.
470 // +optional
471 optional int32 currentAverageUtilization = 2;
472
473 // currentAverageValue is the current value of the average of the
474 // resource metric across all relevant pods, as a raw value (instead of as
475 // a percentage of the request), similar to the "pods" metric source type.
476 // It will always be set, regardless of the corresponding metric specification.
477 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
478}
479
View as plain text