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.v1;
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 = "v1";
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 message ExternalMetricSource {
50 // metricName is the name of the metric in question.
51 optional string metricName = 1;
53 // metricSelector is used to identify a specific time series
54 // within a given metric.
56 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
58 // targetValue is the target value of the metric (as a quantity).
59 // Mutually exclusive with TargetAverageValue.
61 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
63 // targetAverageValue is the target per-pod value of global metric (as a quantity).
64 // Mutually exclusive with TargetValue.
66 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
69 // ExternalMetricStatus indicates the current value of a global metric
70 // not associated with any Kubernetes object.
71 message ExternalMetricStatus {
72 // metricName is the name of a metric used for autoscaling in
74 optional string metricName = 1;
76 // metricSelector is used to identify a specific time series
77 // within a given metric.
79 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
81 // currentValue is the current value of the metric (as a quantity)
82 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
84 // currentAverageValue is the current value of metric averaged over autoscaled pods.
86 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
89 // configuration of a horizontal pod autoscaler.
90 message HorizontalPodAutoscaler {
91 // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
93 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
95 // behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
97 optional HorizontalPodAutoscalerSpec spec = 2;
99 // current information about the autoscaler.
101 optional HorizontalPodAutoscalerStatus status = 3;
104 // HorizontalPodAutoscalerCondition describes the state of
105 // a HorizontalPodAutoscaler at a certain point.
106 message HorizontalPodAutoscalerCondition {
107 // type describes the current condition
108 optional string type = 1;
110 // status is the status of the condition (True, False, Unknown)
111 optional string status = 2;
113 // lastTransitionTime is the last time the condition transitioned from
114 // one status to another
116 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
118 // reason is the reason for the condition's last transition.
120 optional string reason = 4;
122 // message is a human-readable explanation containing details about
125 optional string message = 5;
128 // list of horizontal pod autoscaler objects.
129 message HorizontalPodAutoscalerList {
130 // Standard list metadata.
132 optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
134 // list of horizontal pod autoscaler objects.
135 repeated HorizontalPodAutoscaler items = 2;
138 // specification of a horizontal pod autoscaler.
139 message 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;
144 // lower limit for the number of pods that can be set by the autoscaler, default 1.
146 optional int32 minReplicas = 2;
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;
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.
154 optional int32 targetCPUUtilizationPercentage = 4;
157 // current status of a horizontal pod autoscaler
158 message HorizontalPodAutoscalerStatus {
159 // most recent generation observed by this autoscaler.
161 optional int64 observedGeneration = 1;
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.
166 optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
168 // current number of replicas of pods managed by this autoscaler.
169 optional int32 currentReplicas = 3;
171 // desired number of replicas of pods managed by this autoscaler.
172 optional int32 desiredReplicas = 4;
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.
177 optional int32 currentCPUUtilizationPercentage = 5;
180 // MetricSpec specifies how to scale based on a single metric
181 // (only `type` and one other matching field should be set at once).
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;
187 // object refers to a metric describing a single kubernetes object
188 // (for example, hits-per-second on an Ingress object).
190 optional ObjectMetricSource object = 2;
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.
196 optional PodsMetricSource pods = 3;
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.
204 optional ResourceMetricSource resource = 4;
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).
212 optional ExternalMetricSource external = 5;
215 // MetricStatus describes the last-read state of a single metric.
216 message 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;
221 // object refers to a metric describing a single kubernetes object
222 // (for example, hits-per-second on an Ingress object).
224 optional ObjectMetricStatus object = 2;
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.
230 optional PodsMetricStatus pods = 3;
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.
238 optional ResourceMetricStatus resource = 4;
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).
246 optional ExternalMetricStatus external = 5;
249 // ObjectMetricSource indicates how to scale on a metric describing a
250 // kubernetes object (for example, hits-per-second on an Ingress object).
251 message ObjectMetricSource {
252 // target is the described Kubernetes object.
253 optional CrossVersionObjectReference target = 1;
255 // metricName is the name of the metric in question.
256 optional string metricName = 2;
258 // targetValue is the target value of the metric (as a quantity).
259 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
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.
265 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
267 // averageValue is the target value of the average of the
268 // metric across all relevant pods (as a quantity)
270 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
273 // ObjectMetricStatus indicates the current value of a metric describing a
274 // kubernetes object (for example, hits-per-second on an Ingress object).
275 message ObjectMetricStatus {
276 // target is the described Kubernetes object.
277 optional CrossVersionObjectReference target = 1;
279 // metricName is the name of the metric in question.
280 optional string metricName = 2;
282 // currentValue is the current value of the metric (as a quantity).
283 optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
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.
289 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
291 // averageValue is the current value of the average of the
292 // metric across all relevant pods (as a quantity)
294 optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
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
301 message PodsMetricSource {
302 // metricName is the name of the metric in question
303 optional string metricName = 1;
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;
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.
313 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
316 // PodsMetricStatus indicates the current value of a metric describing each pod in
317 // the current scale target (for example, transactions-processed-per-second).
318 message PodsMetricStatus {
319 // metricName is the name of the metric in question
320 optional string metricName = 1;
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;
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.
330 optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
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
340 message ResourceMetricSource {
341 // name is the name of the resource in question.
342 optional string name = 1;
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.
348 optional int32 targetAverageUtilization = 2;
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.
354 optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
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.
362 message ResourceMetricStatus {
363 // name is the name of the resource in question.
364 optional string name = 1;
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
372 optional int32 currentAverageUtilization = 2;
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;
381 // Scale represents a scaling request for a resource.
383 // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
385 optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
387 // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
389 optional ScaleSpec spec = 2;
391 // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status. Read-only.
393 optional ScaleStatus status = 3;
396 // ScaleSpec describes the attributes of a scale subresource.
398 // desired number of instances for the scaled object.
400 optional int32 replicas = 1;
403 // ScaleStatus represents the current status of a scale subresource.
404 message ScaleStatus {
405 // actual number of observed instances of the scaled object.
406 optional int32 replicas = 1;
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
413 optional string selector = 2;