blob: 2ff7f9e2850cd9c26d8053872fd4f78f1015589e [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001/*
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";
29import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
30
31// Package-wide variables from generator "generated".
32option go_package = "v1";
33
34// CrossVersionObjectReference contains enough information to let you identify the referred resource.
35message CrossVersionObjectReference {
36 // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
37 optional string kind = 1;
38
39 // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
40 optional string name = 2;
41
42 // API version of the referent
43 // +optional
44 optional string apiVersion = 3;
45}
46
47// ExternalMetricSource indicates how to scale on a metric not associated with
48// any Kubernetes object (for example length of queue in cloud
49// messaging service, or QPS from loadbalancer running outside of cluster).
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// configuration of a horizontal pod autoscaler.
91message HorizontalPodAutoscaler {
92 // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
93 // +optional
94 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
95
96 // behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
97 // +optional
98 optional HorizontalPodAutoscalerSpec spec = 2;
99
100 // current information about the autoscaler.
101 // +optional
102 optional HorizontalPodAutoscalerStatus status = 3;
103}
104
105// HorizontalPodAutoscalerCondition describes the state of
106// a HorizontalPodAutoscaler at a certain point.
107message HorizontalPodAutoscalerCondition {
108 // type describes the current condition
109 optional string type = 1;
110
111 // status is the status of the condition (True, False, Unknown)
112 optional string status = 2;
113
114 // lastTransitionTime is the last time the condition transitioned from
115 // one status to another
116 // +optional
117 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
118
119 // reason is the reason for the condition's last transition.
120 // +optional
121 optional string reason = 4;
122
123 // message is a human-readable explanation containing details about
124 // the transition
125 // +optional
126 optional string message = 5;
127}
128
129// list of horizontal pod autoscaler objects.
130message HorizontalPodAutoscalerList {
131 // Standard list metadata.
132 // +optional
133 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
134
135 // list of horizontal pod autoscaler objects.
136 repeated HorizontalPodAutoscaler items = 2;
137}
138
139// specification of a horizontal pod autoscaler.
140message HorizontalPodAutoscalerSpec {
141 // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
142 // and will set the desired number of pods by using its Scale subresource.
143 optional CrossVersionObjectReference scaleTargetRef = 1;
144
145 // lower limit for the number of pods that can be set by the autoscaler, default 1.
146 // +optional
147 optional int32 minReplicas = 2;
148
149 // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
150 optional int32 maxReplicas = 3;
151
152 // target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
153 // if not specified the default autoscaling policy will be used.
154 // +optional
155 optional int32 targetCPUUtilizationPercentage = 4;
156}
157
158// current status of a horizontal pod autoscaler
159message HorizontalPodAutoscalerStatus {
160 // most recent generation observed by this autoscaler.
161 // +optional
162 optional int64 observedGeneration = 1;
163
164 // last time the HorizontalPodAutoscaler scaled the number of pods;
165 // used by the autoscaler to control how often the number of pods is changed.
166 // +optional
167 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
168
169 // current number of replicas of pods managed by this autoscaler.
170 optional int32 currentReplicas = 3;
171
172 // desired number of replicas of pods managed by this autoscaler.
173 optional int32 desiredReplicas = 4;
174
175 // current average CPU utilization over all pods, represented as a percentage of requested CPU,
176 // e.g. 70 means that an average pod is using now 70% of its requested CPU.
177 // +optional
178 optional int32 currentCPUUtilizationPercentage = 5;
179}
180
181// MetricSpec specifies how to scale based on a single metric
182// (only `type` and one other matching field should be set at once).
183message MetricSpec {
184 // type is the type of metric source. It should be one of "Object",
185 // "Pods" or "Resource", each mapping to a matching field in the object.
186 optional string type = 1;
187
188 // object refers to a metric describing a single kubernetes object
189 // (for example, hits-per-second on an Ingress object).
190 // +optional
191 optional ObjectMetricSource object = 2;
192
193 // pods refers to a metric describing each pod in the current scale target
194 // (for example, transactions-processed-per-second). The values will be
195 // averaged together before being compared to the target value.
196 // +optional
197 optional PodsMetricSource pods = 3;
198
199 // resource refers to a resource metric (such as those specified in
200 // requests and limits) known to Kubernetes describing each pod in the
201 // current scale target (e.g. CPU or memory). Such metrics are built in to
202 // Kubernetes, and have special scaling options on top of those available
203 // to normal per-pod metrics using the "pods" source.
204 // +optional
205 optional ResourceMetricSource resource = 4;
206
207 // external refers to a global metric that is not associated
208 // with any Kubernetes object. It allows autoscaling based on information
209 // coming from components running outside of cluster
210 // (for example length of queue in cloud messaging service, or
211 // QPS from loadbalancer running outside of cluster).
212 // +optional
213 optional ExternalMetricSource external = 5;
214}
215
216// MetricStatus describes the last-read state of a single metric.
217message MetricStatus {
218 // type is the type of metric source. It will be one of "Object",
219 // "Pods" or "Resource", each corresponds to a matching field in the object.
220 optional string type = 1;
221
222 // object refers to a metric describing a single kubernetes object
223 // (for example, hits-per-second on an Ingress object).
224 // +optional
225 optional ObjectMetricStatus object = 2;
226
227 // pods refers to a metric describing each pod in the current scale target
228 // (for example, transactions-processed-per-second). The values will be
229 // averaged together before being compared to the target value.
230 // +optional
231 optional PodsMetricStatus pods = 3;
232
233 // resource refers to a resource metric (such as those specified in
234 // requests and limits) known to Kubernetes describing each pod in the
235 // current scale target (e.g. CPU or memory). Such metrics are built in to
236 // Kubernetes, and have special scaling options on top of those available
237 // to normal per-pod metrics using the "pods" source.
238 // +optional
239 optional ResourceMetricStatus resource = 4;
240
241 // external refers to a global metric that is not associated
242 // with any Kubernetes object. It allows autoscaling based on information
243 // coming from components running outside of cluster
244 // (for example length of queue in cloud messaging service, or
245 // QPS from loadbalancer running outside of cluster).
246 // +optional
247 optional ExternalMetricStatus external = 5;
248}
249
250// ObjectMetricSource indicates how to scale on a metric describing a
251// kubernetes object (for example, hits-per-second on an Ingress object).
252message ObjectMetricSource {
253 // target is the described Kubernetes object.
254 optional CrossVersionObjectReference target = 1;
255
256 // metricName is the name of the metric in question.
257 optional string metricName = 2;
258
259 // targetValue is the target value of the metric (as a quantity).
260 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
261}
262
263// ObjectMetricStatus indicates the current value of a metric describing a
264// kubernetes object (for example, hits-per-second on an Ingress object).
265message ObjectMetricStatus {
266 // target is the described Kubernetes object.
267 optional CrossVersionObjectReference target = 1;
268
269 // metricName is the name of the metric in question.
270 optional string metricName = 2;
271
272 // currentValue is the current value of the metric (as a quantity).
273 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
274}
275
276// PodsMetricSource indicates how to scale on a metric describing each pod in
277// the current scale target (for example, transactions-processed-per-second).
278// The values will be averaged together before being compared to the target
279// value.
280message PodsMetricSource {
281 // metricName is the name of the metric in question
282 optional string metricName = 1;
283
284 // targetAverageValue is the target value of the average of the
285 // metric across all relevant pods (as a quantity)
286 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
287}
288
289// PodsMetricStatus indicates the current value of a metric describing each pod in
290// the current scale target (for example, transactions-processed-per-second).
291message PodsMetricStatus {
292 // metricName is the name of the metric in question
293 optional string metricName = 1;
294
295 // currentAverageValue is the current value of the average of the
296 // metric across all relevant pods (as a quantity)
297 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
298}
299
300// ResourceMetricSource indicates how to scale on a resource metric known to
301// Kubernetes, as specified in requests and limits, describing each pod in the
302// current scale target (e.g. CPU or memory). The values will be averaged
303// together before being compared to the target. Such metrics are built in to
304// Kubernetes, and have special scaling options on top of those available to
305// normal per-pod metrics using the "pods" source. Only one "target" type
306// should be set.
307message ResourceMetricSource {
308 // name is the name of the resource in question.
309 optional string name = 1;
310
311 // targetAverageUtilization is the target value of the average of the
312 // resource metric across all relevant pods, represented as a percentage of
313 // the requested value of the resource for the pods.
314 // +optional
315 optional int32 targetAverageUtilization = 2;
316
317 // targetAverageValue is the target value of the average of the
318 // resource metric across all relevant pods, as a raw value (instead of as
319 // a percentage of the request), similar to the "pods" metric source type.
320 // +optional
321 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
322}
323
324// ResourceMetricStatus indicates the current value of a resource metric known to
325// Kubernetes, as specified in requests and limits, describing each pod in the
326// current scale target (e.g. CPU or memory). Such metrics are built in to
327// Kubernetes, and have special scaling options on top of those available to
328// normal per-pod metrics using the "pods" source.
329message ResourceMetricStatus {
330 // name is the name of the resource in question.
331 optional string name = 1;
332
333 // currentAverageUtilization is the current value of the average of the
334 // resource metric across all relevant pods, represented as a percentage of
335 // the requested value of the resource for the pods. It will only be
336 // present if `targetAverageValue` was set in the corresponding metric
337 // specification.
338 // +optional
339 optional int32 currentAverageUtilization = 2;
340
341 // currentAverageValue is the current value of the average of the
342 // resource metric across all relevant pods, as a raw value (instead of as
343 // a percentage of the request), similar to the "pods" metric source type.
344 // It will always be set, regardless of the corresponding metric specification.
345 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
346}
347
348// Scale represents a scaling request for a resource.
349message Scale {
350 // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
351 // +optional
352 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
353
354 // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
355 // +optional
356 optional ScaleSpec spec = 2;
357
358 // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.
359 // +optional
360 optional ScaleStatus status = 3;
361}
362
363// ScaleSpec describes the attributes of a scale subresource.
364message ScaleSpec {
365 // desired number of instances for the scaled object.
366 // +optional
367 optional int32 replicas = 1;
368}
369
370// ScaleStatus represents the current status of a scale subresource.
371message ScaleStatus {
372 // actual number of observed instances of the scaled object.
373 optional int32 replicas = 1;
374
375 // label query over pods that should match the replicas count. This is same
376 // as the label selector but in the string format to avoid introspection
377 // by clients. The string will be in the same format as the query-param syntax.
378 // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
379 // +optional
380 optional string selector = 2;
381}
382