blob: 04bc0ed60143f48c4fba432033b80bb759f44d77 [file] [log] [blame]
sslobodrd046be82019-01-16 10:02:22 -05001/*
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 = "v2beta1";
32
33// CrossVersionObjectReference contains enough information to let you identify the referred resource.
34message 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;
37
38 // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
39 optional string name = 2;
40
41 // API version of the referent
42 // +optional
43 optional string apiVersion = 3;
44}
45
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.
50message ExternalMetricSource {
51 // metricName is the name of the metric in question.
52 optional string metricName = 1;
53
54 // metricSelector is used to identify a specific time series
55 // within a given metric.
56 // +optional
57 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
58
59 // targetValue is the target value of the metric (as a quantity).
60 // Mutually exclusive with TargetAverageValue.
61 // +optional
62 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
63
64 // targetAverageValue is the target per-pod value of global metric (as a quantity).
65 // Mutually exclusive with TargetValue.
66 // +optional
67 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
68}
69
70// ExternalMetricStatus indicates the current value of a global metric
71// not associated with any Kubernetes object.
72message ExternalMetricStatus {
73 // metricName is the name of a metric used for autoscaling in
74 // metric system.
75 optional string metricName = 1;
76
77 // metricSelector is used to identify a specific time series
78 // within a given metric.
79 // +optional
80 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
81
82 // currentValue is the current value of the metric (as a quantity)
83 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
84
85 // currentAverageValue is the current value of metric averaged over autoscaled pods.
86 // +optional
87 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
88}
89
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.
93message HorizontalPodAutoscaler {
94 // metadata is the standard object metadata.
95 // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
96 // +optional
97 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
98
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.
101 // +optional
102 optional HorizontalPodAutoscalerSpec spec = 2;
103
104 // status is the current information about the autoscaler.
105 // +optional
106 optional HorizontalPodAutoscalerStatus status = 3;
107}
108
109// HorizontalPodAutoscalerCondition describes the state of
110// a HorizontalPodAutoscaler at a certain point.
111message HorizontalPodAutoscalerCondition {
112 // type describes the current condition
113 optional string type = 1;
114
115 // status is the status of the condition (True, False, Unknown)
116 optional string status = 2;
117
118 // lastTransitionTime is the last time the condition transitioned from
119 // one status to another
120 // +optional
121 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
122
123 // reason is the reason for the condition's last transition.
124 // +optional
125 optional string reason = 4;
126
127 // message is a human-readable explanation containing details about
128 // the transition
129 // +optional
130 optional string message = 5;
131}
132
133// HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.
134message HorizontalPodAutoscalerList {
135 // metadata is the standard list metadata.
136 // +optional
137 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
138
139 // items is the list of horizontal pod autoscaler objects.
140 repeated HorizontalPodAutoscaler items = 2;
141}
142
143// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
144message 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;
148
149 // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
150 // It defaults to 1 pod.
151 // +optional
152 optional int32 minReplicas = 2;
153
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;
157
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.
165 // +optional
166 repeated MetricSpec metrics = 4;
167}
168
169// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
170message HorizontalPodAutoscalerStatus {
171 // observedGeneration is the most recent generation observed by this autoscaler.
172 // +optional
173 optional int64 observedGeneration = 1;
174
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.
177 // +optional
178 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
179
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;
183
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;
187
188 // currentMetrics is the last read state of the metrics used by this autoscaler.
189 // +optional
190 repeated MetricStatus currentMetrics = 5;
191
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;
195}
196
197// MetricSpec specifies how to scale based on a single metric
198// (only `type` and one other matching field should be set at once).
199message MetricSpec {
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;
203
204 // object refers to a metric describing a single kubernetes object
205 // (for example, hits-per-second on an Ingress object).
206 // +optional
207 optional ObjectMetricSource object = 2;
208
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.
212 // +optional
213 optional PodsMetricSource pods = 3;
214
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.
220 // +optional
221 optional ResourceMetricSource resource = 4;
222
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).
228 // +optional
229 optional ExternalMetricSource external = 5;
230}
231
232// MetricStatus describes the last-read state of a single metric.
233message 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;
237
238 // object refers to a metric describing a single kubernetes object
239 // (for example, hits-per-second on an Ingress object).
240 // +optional
241 optional ObjectMetricStatus object = 2;
242
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.
246 // +optional
247 optional PodsMetricStatus pods = 3;
248
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.
254 // +optional
255 optional ResourceMetricStatus resource = 4;
256
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).
262 // +optional
263 optional ExternalMetricStatus external = 5;
264}
265
266// ObjectMetricSource indicates how to scale on a metric describing a
267// kubernetes object (for example, hits-per-second on an Ingress object).
268message ObjectMetricSource {
269 // target is the described Kubernetes object.
270 optional CrossVersionObjectReference target = 1;
271
272 // metricName is the name of the metric in question.
273 optional string metricName = 2;
274
275 // targetValue is the target value of the metric (as a quantity).
276 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
277
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.
281 // +optional
282 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
283
284 // averageValue is the target value of the average of the
285 // metric across all relevant pods (as a quantity)
286 // +optional
287 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
288}
289
290// ObjectMetricStatus indicates the current value of a metric describing a
291// kubernetes object (for example, hits-per-second on an Ingress object).
292message ObjectMetricStatus {
293 // target is the described Kubernetes object.
294 optional CrossVersionObjectReference target = 1;
295
296 // metricName is the name of the metric in question.
297 optional string metricName = 2;
298
299 // currentValue is the current value of the metric (as a quantity).
300 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
301
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.
305 // +optional
306 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
307
308 // averageValue is the current value of the average of the
309 // metric across all relevant pods (as a quantity)
310 // +optional
311 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
312}
313
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
317// value.
318message PodsMetricSource {
319 // metricName is the name of the metric in question
320 optional string metricName = 1;
321
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;
325
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.
329 // +optional
330 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
331}
332
333// PodsMetricStatus indicates the current value of a metric describing each pod in
334// the current scale target (for example, transactions-processed-per-second).
335message PodsMetricStatus {
336 // metricName is the name of the metric in question
337 optional string metricName = 1;
338
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;
342
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.
346 // +optional
347 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
348}
349
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
356// should be set.
357message ResourceMetricSource {
358 // name is the name of the resource in question.
359 optional string name = 1;
360
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.
364 // +optional
365 optional int32 targetAverageUtilization = 2;
366
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.
370 // +optional
371 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
372}
373
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.
379message ResourceMetricStatus {
380 // name is the name of the resource in question.
381 optional string name = 1;
382
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
387 // specification.
388 // +optional
389 optional int32 currentAverageUtilization = 2;
390
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;
396}
397