blob: 5b56b2ac831666f37ce8dff6025717f424f39466 [file] [log] [blame]
Zack Williamse940c7a2019-08-21 14:25:39 -07001/*
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.v1;
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 = "v1";
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).
49message ExternalMetricSource {
50 // metricName is the name of the metric in question.
51 optional string metricName = 1;
52
53 // metricSelector is used to identify a specific time series
54 // within a given metric.
55 // +optional
56 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
57
58 // targetValue is the target value of the metric (as a quantity).
59 // Mutually exclusive with TargetAverageValue.
60 // +optional
61 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
62
63 // targetAverageValue is the target per-pod value of global metric (as a quantity).
64 // Mutually exclusive with TargetValue.
65 // +optional
66 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
67}
68
69// ExternalMetricStatus indicates the current value of a global metric
70// not associated with any Kubernetes object.
71message ExternalMetricStatus {
72 // metricName is the name of a metric used for autoscaling in
73 // metric system.
74 optional string metricName = 1;
75
76 // metricSelector is used to identify a specific time series
77 // within a given metric.
78 // +optional
79 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
80
81 // currentValue is the current value of the metric (as a quantity)
82 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
83
84 // currentAverageValue is the current value of metric averaged over autoscaled pods.
85 // +optional
86 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
87}
88
89// configuration of a horizontal pod autoscaler.
90message HorizontalPodAutoscaler {
91 // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
92 // +optional
93 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
94
95 // behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
96 // +optional
97 optional HorizontalPodAutoscalerSpec spec = 2;
98
99 // current information about the autoscaler.
100 // +optional
101 optional HorizontalPodAutoscalerStatus status = 3;
102}
103
104// HorizontalPodAutoscalerCondition describes the state of
105// a HorizontalPodAutoscaler at a certain point.
106message HorizontalPodAutoscalerCondition {
107 // type describes the current condition
108 optional string type = 1;
109
110 // status is the status of the condition (True, False, Unknown)
111 optional string status = 2;
112
113 // lastTransitionTime is the last time the condition transitioned from
114 // one status to another
115 // +optional
116 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
117
118 // reason is the reason for the condition's last transition.
119 // +optional
120 optional string reason = 4;
121
122 // message is a human-readable explanation containing details about
123 // the transition
124 // +optional
125 optional string message = 5;
126}
127
128// list of horizontal pod autoscaler objects.
129message HorizontalPodAutoscalerList {
130 // Standard list metadata.
131 // +optional
132 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
133
134 // list of horizontal pod autoscaler objects.
135 repeated HorizontalPodAutoscaler items = 2;
136}
137
138// specification of a horizontal pod autoscaler.
139message HorizontalPodAutoscalerSpec {
140 // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
141 // and will set the desired number of pods by using its Scale subresource.
142 optional CrossVersionObjectReference scaleTargetRef = 1;
143
144 // lower limit for the number of pods that can be set by the autoscaler, default 1.
145 // +optional
146 optional int32 minReplicas = 2;
147
148 // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
149 optional int32 maxReplicas = 3;
150
151 // target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
152 // if not specified the default autoscaling policy will be used.
153 // +optional
154 optional int32 targetCPUUtilizationPercentage = 4;
155}
156
157// current status of a horizontal pod autoscaler
158message HorizontalPodAutoscalerStatus {
159 // most recent generation observed by this autoscaler.
160 // +optional
161 optional int64 observedGeneration = 1;
162
163 // last time the HorizontalPodAutoscaler scaled the number of pods;
164 // used by the autoscaler to control how often the number of pods is changed.
165 // +optional
166 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
167
168 // current number of replicas of pods managed by this autoscaler.
169 optional int32 currentReplicas = 3;
170
171 // desired number of replicas of pods managed by this autoscaler.
172 optional int32 desiredReplicas = 4;
173
174 // current average CPU utilization over all pods, represented as a percentage of requested CPU,
175 // e.g. 70 means that an average pod is using now 70% of its requested CPU.
176 // +optional
177 optional int32 currentCPUUtilizationPercentage = 5;
178}
179
180// MetricSpec specifies how to scale based on a single metric
181// (only `type` and one other matching field should be set at once).
182message MetricSpec {
183 // type is the type of metric source. It should be one of "Object",
184 // "Pods" or "Resource", each mapping to a matching field in the object.
185 optional string type = 1;
186
187 // object refers to a metric describing a single kubernetes object
188 // (for example, hits-per-second on an Ingress object).
189 // +optional
190 optional ObjectMetricSource object = 2;
191
192 // pods refers to a metric describing each pod in the current scale target
193 // (for example, transactions-processed-per-second). The values will be
194 // averaged together before being compared to the target value.
195 // +optional
196 optional PodsMetricSource pods = 3;
197
198 // resource refers to a resource metric (such as those specified in
199 // requests and limits) known to Kubernetes describing each pod in the
200 // current scale target (e.g. CPU or memory). Such metrics are built in to
201 // Kubernetes, and have special scaling options on top of those available
202 // to normal per-pod metrics using the "pods" source.
203 // +optional
204 optional ResourceMetricSource resource = 4;
205
206 // external refers to a global metric that is not associated
207 // with any Kubernetes object. It allows autoscaling based on information
208 // coming from components running outside of cluster
209 // (for example length of queue in cloud messaging service, or
210 // QPS from loadbalancer running outside of cluster).
211 // +optional
212 optional ExternalMetricSource external = 5;
213}
214
215// MetricStatus describes the last-read state of a single metric.
216message MetricStatus {
217 // type is the type of metric source. It will be one of "Object",
218 // "Pods" or "Resource", each corresponds to a matching field in the object.
219 optional string type = 1;
220
221 // object refers to a metric describing a single kubernetes object
222 // (for example, hits-per-second on an Ingress object).
223 // +optional
224 optional ObjectMetricStatus object = 2;
225
226 // pods refers to a metric describing each pod in the current scale target
227 // (for example, transactions-processed-per-second). The values will be
228 // averaged together before being compared to the target value.
229 // +optional
230 optional PodsMetricStatus pods = 3;
231
232 // resource refers to a resource metric (such as those specified in
233 // requests and limits) known to Kubernetes describing each pod in the
234 // current scale target (e.g. CPU or memory). Such metrics are built in to
235 // Kubernetes, and have special scaling options on top of those available
236 // to normal per-pod metrics using the "pods" source.
237 // +optional
238 optional ResourceMetricStatus resource = 4;
239
240 // external refers to a global metric that is not associated
241 // with any Kubernetes object. It allows autoscaling based on information
242 // coming from components running outside of cluster
243 // (for example length of queue in cloud messaging service, or
244 // QPS from loadbalancer running outside of cluster).
245 // +optional
246 optional ExternalMetricStatus external = 5;
247}
248
249// ObjectMetricSource indicates how to scale on a metric describing a
250// kubernetes object (for example, hits-per-second on an Ingress object).
251message ObjectMetricSource {
252 // target is the described Kubernetes object.
253 optional CrossVersionObjectReference target = 1;
254
255 // metricName is the name of the metric in question.
256 optional string metricName = 2;
257
258 // targetValue is the target value of the metric (as a quantity).
259 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
260
261 // selector is the string-encoded form of a standard kubernetes label selector for the given metric.
262 // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
263 // When unset, just the metricName will be used to gather metrics.
264 // +optional
265 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
266
267 // averageValue is the target value of the average of the
268 // metric across all relevant pods (as a quantity)
269 // +optional
270 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
271}
272
273// ObjectMetricStatus indicates the current value of a metric describing a
274// kubernetes object (for example, hits-per-second on an Ingress object).
275message ObjectMetricStatus {
276 // target is the described Kubernetes object.
277 optional CrossVersionObjectReference target = 1;
278
279 // metricName is the name of the metric in question.
280 optional string metricName = 2;
281
282 // currentValue is the current value of the metric (as a quantity).
283 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
284
285 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
286 // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
287 // When unset, just the metricName will be used to gather metrics.
288 // +optional
289 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
290
291 // averageValue is the current value of the average of the
292 // metric across all relevant pods (as a quantity)
293 // +optional
294 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
295}
296
297// PodsMetricSource indicates how to scale on a metric describing each pod in
298// the current scale target (for example, transactions-processed-per-second).
299// The values will be averaged together before being compared to the target
300// value.
301message PodsMetricSource {
302 // metricName is the name of the metric in question
303 optional string metricName = 1;
304
305 // targetAverageValue is the target value of the average of the
306 // metric across all relevant pods (as a quantity)
307 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
308
309 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
310 // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
311 // When unset, just the metricName will be used to gather metrics.
312 // +optional
313 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
314}
315
316// PodsMetricStatus indicates the current value of a metric describing each pod in
317// the current scale target (for example, transactions-processed-per-second).
318message PodsMetricStatus {
319 // metricName is the name of the metric in question
320 optional string metricName = 1;
321
322 // currentAverageValue is the current value of the average of the
323 // metric across all relevant pods (as a quantity)
324 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
325
326 // selector is the string-encoded form of a standard kubernetes label selector for the given metric
327 // When set in the PodsMetricSource, 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// ResourceMetricSource indicates how to scale on a resource metric known to
334// Kubernetes, as specified in requests and limits, describing each pod in the
335// current scale target (e.g. CPU or memory). The values will be averaged
336// together before being compared to the target. Such metrics are built in to
337// Kubernetes, and have special scaling options on top of those available to
338// normal per-pod metrics using the "pods" source. Only one "target" type
339// should be set.
340message ResourceMetricSource {
341 // name is the name of the resource in question.
342 optional string name = 1;
343
344 // targetAverageUtilization is the target value of the average of the
345 // resource metric across all relevant pods, represented as a percentage of
346 // the requested value of the resource for the pods.
347 // +optional
348 optional int32 targetAverageUtilization = 2;
349
350 // targetAverageValue is the target value of the average of the
351 // resource metric across all relevant pods, as a raw value (instead of as
352 // a percentage of the request), similar to the "pods" metric source type.
353 // +optional
354 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
355}
356
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.
362message ResourceMetricStatus {
363 // name is the name of the resource in question.
364 optional string name = 1;
365
366 // currentAverageUtilization is the current value of the average of the
367 // resource metric across all relevant pods, represented as a percentage of
368 // the requested value of the resource for the pods. It will only be
369 // present if `targetAverageValue` was set in the corresponding metric
370 // specification.
371 // +optional
372 optional int32 currentAverageUtilization = 2;
373
374 // currentAverageValue is the current value of the average of the
375 // resource metric across all relevant pods, as a raw value (instead of as
376 // a percentage of the request), similar to the "pods" metric source type.
377 // It will always be set, regardless of the corresponding metric specification.
378 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
379}
380
381// Scale represents a scaling request for a resource.
382message Scale {
383 // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
384 // +optional
385 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
386
387 // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
388 // +optional
389 optional ScaleSpec spec = 2;
390
391 // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.
392 // +optional
393 optional ScaleStatus status = 3;
394}
395
396// ScaleSpec describes the attributes of a scale subresource.
397message ScaleSpec {
398 // desired number of instances for the scaled object.
399 // +optional
400 optional int32 replicas = 1;
401}
402
403// ScaleStatus represents the current status of a scale subresource.
404message ScaleStatus {
405 // actual number of observed instances of the scaled object.
406 optional int32 replicas = 1;
407
408 // label query over pods that should match the replicas count. This is same
409 // as the label selector but in the string format to avoid introspection
410 // by clients. The string will be in the same format as the query-param syntax.
411 // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
412 // +optional
413 optional string selector = 2;
414}
415