k8s_pb/api/autoscaling/v2/mod.rs
1// This file is @generated by prost-build.
2/// ContainerResourceMetricSource indicates how to scale on a resource metric known to
3/// Kubernetes, as specified in requests and limits, describing each pod in the
4/// current scale target (e.g. CPU or memory). The values will be averaged
5/// together before being compared to the target. Such metrics are built in to
6/// Kubernetes, and have special scaling options on top of those available to
7/// normal per-pod metrics using the "pods" source. Only one "target" type
8/// should be set.
9#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10pub struct ContainerResourceMetricSource {
11 /// name is the name of the resource in question.
12 #[prost(string, optional, tag = "1")]
13 pub name: ::core::option::Option<::prost::alloc::string::String>,
14 /// target specifies the target value for the given metric
15 #[prost(message, optional, tag = "2")]
16 pub target: ::core::option::Option<MetricTarget>,
17 /// container is the name of the container in the pods of the scaling target
18 #[prost(string, optional, tag = "3")]
19 pub container: ::core::option::Option<::prost::alloc::string::String>,
20}
21/// ContainerResourceMetricStatus indicates the current value of a resource metric known to
22/// Kubernetes, as specified in requests and limits, describing a single container in each pod in the
23/// current scale target (e.g. CPU or memory). Such metrics are built in to
24/// Kubernetes, and have special scaling options on top of those available to
25/// normal per-pod metrics using the "pods" source.
26#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
27pub struct ContainerResourceMetricStatus {
28 /// name is the name of the resource in question.
29 #[prost(string, optional, tag = "1")]
30 pub name: ::core::option::Option<::prost::alloc::string::String>,
31 /// current contains the current value for the given metric
32 #[prost(message, optional, tag = "2")]
33 pub current: ::core::option::Option<MetricValueStatus>,
34 /// container is the name of the container in the pods of the scaling target
35 #[prost(string, optional, tag = "3")]
36 pub container: ::core::option::Option<::prost::alloc::string::String>,
37}
38/// CrossVersionObjectReference contains enough information to let you identify the referred resource.
39#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
40pub struct CrossVersionObjectReference {
41 /// kind is the kind of the referent; More info: <https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds>
42 #[prost(string, optional, tag = "1")]
43 pub kind: ::core::option::Option<::prost::alloc::string::String>,
44 /// name is the name of the referent; More info: <https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names>
45 #[prost(string, optional, tag = "2")]
46 pub name: ::core::option::Option<::prost::alloc::string::String>,
47 /// apiVersion is the API version of the referent
48 /// +optional
49 #[prost(string, optional, tag = "3")]
50 pub api_version: ::core::option::Option<::prost::alloc::string::String>,
51}
52/// ExternalMetricSource indicates how to scale on a metric not associated with
53/// any Kubernetes object (for example length of queue in cloud
54/// messaging service, or QPS from loadbalancer running outside of cluster).
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct ExternalMetricSource {
57 /// metric identifies the target metric by name and selector
58 #[prost(message, optional, tag = "1")]
59 pub metric: ::core::option::Option<MetricIdentifier>,
60 /// target specifies the target value for the given metric
61 #[prost(message, optional, tag = "2")]
62 pub target: ::core::option::Option<MetricTarget>,
63}
64/// ExternalMetricStatus indicates the current value of a global metric
65/// not associated with any Kubernetes object.
66#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct ExternalMetricStatus {
68 /// metric identifies the target metric by name and selector
69 #[prost(message, optional, tag = "1")]
70 pub metric: ::core::option::Option<MetricIdentifier>,
71 /// current contains the current value for the given metric
72 #[prost(message, optional, tag = "2")]
73 pub current: ::core::option::Option<MetricValueStatus>,
74}
75/// HPAScalingPolicy is a single policy which must hold true for a specified past interval.
76#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
77pub struct HpaScalingPolicy {
78 /// type is used to specify the scaling policy.
79 #[prost(string, optional, tag = "1")]
80 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
81 /// value contains the amount of change which is permitted by the policy.
82 /// It must be greater than zero
83 #[prost(int32, optional, tag = "2")]
84 pub value: ::core::option::Option<i32>,
85 /// periodSeconds specifies the window of time for which the policy should hold true.
86 /// PeriodSeconds must be greater than zero and less than or equal to 1800 (30 min).
87 #[prost(int32, optional, tag = "3")]
88 pub period_seconds: ::core::option::Option<i32>,
89}
90/// HPAScalingRules configures the scaling behavior for one direction via
91/// scaling Policy Rules and a configurable metric tolerance.
92///
93/// Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA.
94/// They can limit the scaling velocity by specifying scaling policies.
95/// They can prevent flapping by specifying the stabilization window, so that the
96/// number of replicas is not set instantly, instead, the safest value from the stabilization
97/// window is chosen.
98///
99/// The tolerance is applied to the metric values and prevents scaling too
100/// eagerly for small metric variations. (Note that setting a tolerance requires
101/// the beta HPAConfigurableTolerance feature gate to be enabled.)
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct HpaScalingRules {
104 /// stabilizationWindowSeconds is the number of seconds for which past recommendations should be
105 /// considered while scaling up or scaling down.
106 /// StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour).
107 /// If not set, use the default values:
108 /// - For scale up: 0 (i.e. no stabilization is done).
109 /// - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
110 /// +optional
111 #[prost(int32, optional, tag = "3")]
112 pub stabilization_window_seconds: ::core::option::Option<i32>,
113 /// selectPolicy is used to specify which policy should be used.
114 /// If not set, the default value Max is used.
115 /// +optional
116 #[prost(string, optional, tag = "1")]
117 pub select_policy: ::core::option::Option<::prost::alloc::string::String>,
118 /// policies is a list of potential scaling polices which can be used during scaling.
119 /// If not set, use the default values:
120 /// - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window.
121 /// - For scale down: allow all pods to be removed in a 15s window.
122 /// +listType=atomic
123 /// +optional
124 #[prost(message, repeated, tag = "2")]
125 pub policies: ::prost::alloc::vec::Vec<HpaScalingPolicy>,
126 /// tolerance is the tolerance on the ratio between the current and desired
127 /// metric value under which no updates are made to the desired number of
128 /// replicas (e.g. 0.01 for 1%). Must be greater than or equal to zero. If not
129 /// set, the default cluster-wide tolerance is applied (by default 10%).
130 ///
131 /// For example, if autoscaling is configured with a memory consumption target of 100Mi,
132 /// and scale-down and scale-up tolerances of 5% and 1% respectively, scaling will be
133 /// triggered when the actual consumption falls below 95Mi or exceeds 101Mi.
134 ///
135 /// This is an beta field and requires the HPAConfigurableTolerance feature
136 /// gate to be enabled.
137 ///
138 /// +featureGate=HPAConfigurableTolerance
139 /// +optional
140 #[prost(message, optional, tag = "4")]
141 pub tolerance: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
142}
143/// HorizontalPodAutoscaler is the configuration for a horizontal pod
144/// autoscaler, which automatically manages the replica count of any resource
145/// implementing the scale subresource based on the metrics specified.
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct 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 #[prost(message, optional, tag = "1")]
152 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ObjectMeta>,
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 #[prost(message, optional, tag = "2")]
157 pub spec: ::core::option::Option<HorizontalPodAutoscalerSpec>,
158 /// status is the current information about the autoscaler.
159 /// +optional
160 #[prost(message, optional, tag = "3")]
161 pub status: ::core::option::Option<HorizontalPodAutoscalerStatus>,
162}
163/// HorizontalPodAutoscalerBehavior configures the scaling behavior of the target
164/// in both Up and Down directions (scaleUp and scaleDown fields respectively).
165#[derive(Clone, PartialEq, ::prost::Message)]
166pub struct HorizontalPodAutoscalerBehavior {
167 /// scaleUp is scaling policy for scaling Up.
168 /// If not set, the default value is the higher of:
169 /// * increase no more than 4 pods per 60 seconds
170 /// * double the number of pods per 60 seconds
171 /// No stabilization is used.
172 /// +optional
173 #[prost(message, optional, tag = "1")]
174 pub scale_up: ::core::option::Option<HpaScalingRules>,
175 /// scaleDown is scaling policy for scaling Down.
176 /// If not set, the default value is to allow to scale down to minReplicas pods, with a
177 /// 300 second stabilization window (i.e., the highest recommendation for
178 /// the last 300sec is used).
179 /// +optional
180 #[prost(message, optional, tag = "2")]
181 pub scale_down: ::core::option::Option<HpaScalingRules>,
182}
183/// HorizontalPodAutoscalerCondition describes the state of
184/// a HorizontalPodAutoscaler at a certain point.
185#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
186pub struct HorizontalPodAutoscalerCondition {
187 /// type describes the current condition
188 #[prost(string, optional, tag = "1")]
189 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
190 /// status is the status of the condition (True, False, Unknown)
191 #[prost(string, optional, tag = "2")]
192 pub status: ::core::option::Option<::prost::alloc::string::String>,
193 /// lastTransitionTime is the last time the condition transitioned from
194 /// one status to another
195 /// +optional
196 #[prost(message, optional, tag = "3")]
197 pub last_transition_time:
198 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
199 /// reason is the reason for the condition's last transition.
200 /// +optional
201 #[prost(string, optional, tag = "4")]
202 pub reason: ::core::option::Option<::prost::alloc::string::String>,
203 /// message is a human-readable explanation containing details about
204 /// the transition
205 /// +optional
206 #[prost(string, optional, tag = "5")]
207 pub message: ::core::option::Option<::prost::alloc::string::String>,
208}
209/// HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
210#[derive(Clone, PartialEq, ::prost::Message)]
211pub struct HorizontalPodAutoscalerList {
212 /// metadata is the standard list metadata.
213 /// +optional
214 #[prost(message, optional, tag = "1")]
215 pub metadata: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::ListMeta>,
216 /// items is the list of horizontal pod autoscaler objects.
217 #[prost(message, repeated, tag = "2")]
218 pub items: ::prost::alloc::vec::Vec<HorizontalPodAutoscaler>,
219}
220/// HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct HorizontalPodAutoscalerSpec {
223 /// scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
224 /// should be collected, as well as to actually change the replica count.
225 #[prost(message, optional, tag = "1")]
226 pub scale_target_ref: ::core::option::Option<CrossVersionObjectReference>,
227 /// minReplicas is the lower limit for the number of replicas to which the autoscaler
228 /// can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
229 /// alpha feature gate HPAScaleToZero is enabled and at least one Object or External
230 /// metric is configured. Scaling is active as long as at least one metric value is
231 /// available.
232 /// +optional
233 #[prost(int32, optional, tag = "2")]
234 pub min_replicas: ::core::option::Option<i32>,
235 /// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
236 /// It cannot be less that minReplicas.
237 #[prost(int32, optional, tag = "3")]
238 pub max_replicas: ::core::option::Option<i32>,
239 /// metrics contains the specifications for which to use to calculate the
240 /// desired replica count (the maximum replica count across all metrics will
241 /// be used). The desired replica count is calculated multiplying the
242 /// ratio between the target value and the current value by the current
243 /// number of pods. Ergo, metrics used must decrease as the pod count is
244 /// increased, and vice-versa. See the individual metric source types for
245 /// more information about how each type of metric must respond.
246 /// If not set, the default metric will be set to 80% average CPU utilization.
247 /// +listType=atomic
248 /// +optional
249 #[prost(message, repeated, tag = "4")]
250 pub metrics: ::prost::alloc::vec::Vec<MetricSpec>,
251 /// behavior configures the scaling behavior of the target
252 /// in both Up and Down directions (scaleUp and scaleDown fields respectively).
253 /// If not set, the default HPAScalingRules for scale up and scale down are used.
254 /// +optional
255 #[prost(message, optional, tag = "5")]
256 pub behavior: ::core::option::Option<HorizontalPodAutoscalerBehavior>,
257}
258/// HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
259#[derive(Clone, PartialEq, ::prost::Message)]
260pub struct HorizontalPodAutoscalerStatus {
261 /// observedGeneration is the most recent generation observed by this autoscaler.
262 /// +optional
263 #[prost(int64, optional, tag = "1")]
264 pub observed_generation: ::core::option::Option<i64>,
265 /// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
266 /// used by the autoscaler to control how often the number of pods is changed.
267 /// +optional
268 #[prost(message, optional, tag = "2")]
269 pub last_scale_time: ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::Time>,
270 /// currentReplicas is current number of replicas of pods managed by this autoscaler,
271 /// as last seen by the autoscaler.
272 /// +optional
273 #[prost(int32, optional, tag = "3")]
274 pub current_replicas: ::core::option::Option<i32>,
275 /// desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
276 /// as last calculated by the autoscaler.
277 #[prost(int32, optional, tag = "4")]
278 pub desired_replicas: ::core::option::Option<i32>,
279 /// currentMetrics is the last read state of the metrics used by this autoscaler.
280 /// +listType=atomic
281 /// +optional
282 #[prost(message, repeated, tag = "5")]
283 pub current_metrics: ::prost::alloc::vec::Vec<MetricStatus>,
284 /// conditions is the set of conditions required for this autoscaler to scale its target,
285 /// and indicates whether or not those conditions are met.
286 /// +patchMergeKey=type
287 /// +patchStrategy=merge
288 /// +listType=map
289 /// +listMapKey=type
290 /// +optional
291 #[prost(message, repeated, tag = "6")]
292 pub conditions: ::prost::alloc::vec::Vec<HorizontalPodAutoscalerCondition>,
293}
294/// MetricIdentifier defines the name and optionally selector for a metric
295#[derive(Clone, PartialEq, ::prost::Message)]
296pub struct MetricIdentifier {
297 /// name is the name of the given metric
298 #[prost(string, optional, tag = "1")]
299 pub name: ::core::option::Option<::prost::alloc::string::String>,
300 /// selector is the string-encoded form of a standard kubernetes label selector for the given metric
301 /// When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
302 /// When unset, just the metricName will be used to gather metrics.
303 /// +optional
304 #[prost(message, optional, tag = "2")]
305 pub selector:
306 ::core::option::Option<super::super::super::apimachinery::pkg::apis::meta::v1::LabelSelector>,
307}
308/// MetricSpec specifies how to scale based on a single metric
309/// (only `type` and one other matching field should be set at once).
310#[derive(Clone, PartialEq, ::prost::Message)]
311pub struct MetricSpec {
312 /// type is the type of metric source. It should be one of "ContainerResource", "External",
313 /// "Object", "Pods" or "Resource", each mapping to a matching field in the object.
314 #[prost(string, optional, tag = "1")]
315 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
316 /// object refers to a metric describing a single kubernetes object
317 /// (for example, hits-per-second on an Ingress object).
318 /// +optional
319 #[prost(message, optional, tag = "2")]
320 pub object: ::core::option::Option<ObjectMetricSource>,
321 /// pods refers to a metric describing each pod in the current scale target
322 /// (for example, transactions-processed-per-second). The values will be
323 /// averaged together before being compared to the target value.
324 /// +optional
325 #[prost(message, optional, tag = "3")]
326 pub pods: ::core::option::Option<PodsMetricSource>,
327 /// resource refers to a resource metric (such as those specified in
328 /// requests and limits) known to Kubernetes describing each pod in the
329 /// current scale target (e.g. CPU or memory). Such metrics are built in to
330 /// Kubernetes, and have special scaling options on top of those available
331 /// to normal per-pod metrics using the "pods" source.
332 /// +optional
333 #[prost(message, optional, tag = "4")]
334 pub resource: ::core::option::Option<ResourceMetricSource>,
335 /// containerResource refers to a resource metric (such as those specified in
336 /// requests and limits) known to Kubernetes describing a single container in
337 /// each pod of the current scale target (e.g. CPU or memory). Such metrics are
338 /// built in to Kubernetes, and have special scaling options on top of those
339 /// available to normal per-pod metrics using the "pods" source.
340 /// +optional
341 #[prost(message, optional, tag = "7")]
342 pub container_resource: ::core::option::Option<ContainerResourceMetricSource>,
343 /// external refers to a global metric that is not associated
344 /// with any Kubernetes object. It allows autoscaling based on information
345 /// coming from components running outside of cluster
346 /// (for example length of queue in cloud messaging service, or
347 /// QPS from loadbalancer running outside of cluster).
348 /// +optional
349 #[prost(message, optional, tag = "5")]
350 pub external: ::core::option::Option<ExternalMetricSource>,
351}
352/// MetricStatus describes the last-read state of a single metric.
353#[derive(Clone, PartialEq, ::prost::Message)]
354pub struct MetricStatus {
355 /// type is the type of metric source. It will be one of "ContainerResource", "External",
356 /// "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
357 #[prost(string, optional, tag = "1")]
358 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
359 /// object refers to a metric describing a single kubernetes object
360 /// (for example, hits-per-second on an Ingress object).
361 /// +optional
362 #[prost(message, optional, tag = "2")]
363 pub object: ::core::option::Option<ObjectMetricStatus>,
364 /// pods refers to a metric describing each pod in the current scale target
365 /// (for example, transactions-processed-per-second). The values will be
366 /// averaged together before being compared to the target value.
367 /// +optional
368 #[prost(message, optional, tag = "3")]
369 pub pods: ::core::option::Option<PodsMetricStatus>,
370 /// resource refers to a resource metric (such as those specified in
371 /// requests and limits) known to Kubernetes describing each pod in the
372 /// current scale target (e.g. CPU or memory). Such metrics are built in to
373 /// Kubernetes, and have special scaling options on top of those available
374 /// to normal per-pod metrics using the "pods" source.
375 /// +optional
376 #[prost(message, optional, tag = "4")]
377 pub resource: ::core::option::Option<ResourceMetricStatus>,
378 /// container resource refers to a resource metric (such as those specified in
379 /// requests and limits) known to Kubernetes describing a single container in each pod in the
380 /// current scale target (e.g. CPU or memory). Such metrics are built in to
381 /// Kubernetes, and have special scaling options on top of those available
382 /// to normal per-pod metrics using the "pods" source.
383 /// +optional
384 #[prost(message, optional, tag = "7")]
385 pub container_resource: ::core::option::Option<ContainerResourceMetricStatus>,
386 /// external refers to a global metric that is not associated
387 /// with any Kubernetes object. It allows autoscaling based on information
388 /// coming from components running outside of cluster
389 /// (for example length of queue in cloud messaging service, or
390 /// QPS from loadbalancer running outside of cluster).
391 /// +optional
392 #[prost(message, optional, tag = "5")]
393 pub external: ::core::option::Option<ExternalMetricStatus>,
394}
395/// MetricTarget defines the target value, average value, or average utilization of a specific metric
396#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
397pub struct MetricTarget {
398 /// type represents whether the metric type is Utilization, Value, or AverageValue
399 #[prost(string, optional, tag = "1")]
400 pub r#type: ::core::option::Option<::prost::alloc::string::String>,
401 /// value is the target value of the metric (as a quantity).
402 /// +optional
403 #[prost(message, optional, tag = "2")]
404 pub value: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
405 /// averageValue is the target value of the average of the
406 /// metric across all relevant pods (as a quantity)
407 /// +optional
408 #[prost(message, optional, tag = "3")]
409 pub average_value:
410 ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
411 /// averageUtilization is the target value of the average of the
412 /// resource metric across all relevant pods, represented as a percentage of
413 /// the requested value of the resource for the pods.
414 /// Currently only valid for Resource metric source type
415 /// +optional
416 #[prost(int32, optional, tag = "4")]
417 pub average_utilization: ::core::option::Option<i32>,
418}
419/// MetricValueStatus holds the current value for a metric
420#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
421pub struct MetricValueStatus {
422 /// value is the current value of the metric (as a quantity).
423 /// +optional
424 #[prost(message, optional, tag = "1")]
425 pub value: ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
426 /// averageValue is the current value of the average of the
427 /// metric across all relevant pods (as a quantity)
428 /// +optional
429 #[prost(message, optional, tag = "2")]
430 pub average_value:
431 ::core::option::Option<super::super::super::apimachinery::pkg::api::resource::Quantity>,
432 /// currentAverageUtilization is the current value of the average of the
433 /// resource metric across all relevant pods, represented as a percentage of
434 /// the requested value of the resource for the pods.
435 /// +optional
436 #[prost(int32, optional, tag = "3")]
437 pub average_utilization: ::core::option::Option<i32>,
438}
439/// ObjectMetricSource indicates how to scale on a metric describing a
440/// kubernetes object (for example, hits-per-second on an Ingress object).
441#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct ObjectMetricSource {
443 /// describedObject specifies the descriptions of a object,such as kind,name apiVersion
444 #[prost(message, optional, tag = "1")]
445 pub described_object: ::core::option::Option<CrossVersionObjectReference>,
446 /// target specifies the target value for the given metric
447 #[prost(message, optional, tag = "2")]
448 pub target: ::core::option::Option<MetricTarget>,
449 /// metric identifies the target metric by name and selector
450 #[prost(message, optional, tag = "3")]
451 pub metric: ::core::option::Option<MetricIdentifier>,
452}
453/// ObjectMetricStatus indicates the current value of a metric describing a
454/// kubernetes object (for example, hits-per-second on an Ingress object).
455#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct ObjectMetricStatus {
457 /// metric identifies the target metric by name and selector
458 #[prost(message, optional, tag = "1")]
459 pub metric: ::core::option::Option<MetricIdentifier>,
460 /// current contains the current value for the given metric
461 #[prost(message, optional, tag = "2")]
462 pub current: ::core::option::Option<MetricValueStatus>,
463 /// DescribedObject specifies the descriptions of a object,such as kind,name apiVersion
464 #[prost(message, optional, tag = "3")]
465 pub described_object: ::core::option::Option<CrossVersionObjectReference>,
466}
467/// PodsMetricSource indicates how to scale on a metric describing each pod in
468/// the current scale target (for example, transactions-processed-per-second).
469/// The values will be averaged together before being compared to the target
470/// value.
471#[derive(Clone, PartialEq, ::prost::Message)]
472pub struct PodsMetricSource {
473 /// metric identifies the target metric by name and selector
474 #[prost(message, optional, tag = "1")]
475 pub metric: ::core::option::Option<MetricIdentifier>,
476 /// target specifies the target value for the given metric
477 #[prost(message, optional, tag = "2")]
478 pub target: ::core::option::Option<MetricTarget>,
479}
480/// PodsMetricStatus indicates the current value of a metric describing each pod in
481/// the current scale target (for example, transactions-processed-per-second).
482#[derive(Clone, PartialEq, ::prost::Message)]
483pub struct PodsMetricStatus {
484 /// metric identifies the target metric by name and selector
485 #[prost(message, optional, tag = "1")]
486 pub metric: ::core::option::Option<MetricIdentifier>,
487 /// current contains the current value for the given metric
488 #[prost(message, optional, tag = "2")]
489 pub current: ::core::option::Option<MetricValueStatus>,
490}
491/// ResourceMetricSource indicates how to scale on a resource metric known to
492/// Kubernetes, as specified in requests and limits, describing each pod in the
493/// current scale target (e.g. CPU or memory). The values will be averaged
494/// together before being compared to the target. Such metrics are built in to
495/// Kubernetes, and have special scaling options on top of those available to
496/// normal per-pod metrics using the "pods" source. Only one "target" type
497/// should be set.
498#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
499pub struct ResourceMetricSource {
500 /// name is the name of the resource in question.
501 #[prost(string, optional, tag = "1")]
502 pub name: ::core::option::Option<::prost::alloc::string::String>,
503 /// target specifies the target value for the given metric
504 #[prost(message, optional, tag = "2")]
505 pub target: ::core::option::Option<MetricTarget>,
506}
507/// ResourceMetricStatus indicates the current value of a resource metric known to
508/// Kubernetes, as specified in requests and limits, describing each pod in the
509/// current scale target (e.g. CPU or memory). Such metrics are built in to
510/// Kubernetes, and have special scaling options on top of those available to
511/// normal per-pod metrics using the "pods" source.
512#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
513pub struct ResourceMetricStatus {
514 /// name is the name of the resource in question.
515 #[prost(string, optional, tag = "1")]
516 pub name: ::core::option::Option<::prost::alloc::string::String>,
517 /// current contains the current value for the given metric
518 #[prost(message, optional, tag = "2")]
519 pub current: ::core::option::Option<MetricValueStatus>,
520}
521
522impl crate::Resource for HorizontalPodAutoscaler {
523 const API_VERSION: &'static str = "autoscaling/v2";
524 const GROUP: &'static str = "autoscaling";
525 const VERSION: &'static str = "v2";
526 const KIND: &'static str = "HorizontalPodAutoscaler";
527 const URL_PATH_SEGMENT: &'static str = "horizontalpodautoscalers";
528 type Scope = crate::NamespaceResourceScope;
529}
530impl crate::Metadata for HorizontalPodAutoscaler {
531 type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta;
532 fn metadata(&self) -> Option<&<Self as crate::Metadata>::Ty> {
533 self.metadata.as_ref()
534 }
535 fn metadata_mut(&mut self) -> Option<&mut <Self as crate::Metadata>::Ty> {
536 self.metadata.as_mut()
537 }
538}
539impl crate::HasSpec for HorizontalPodAutoscaler {
540 type Spec = crate::api::autoscaling::v2::HorizontalPodAutoscalerSpec;
541 fn spec(&self) -> Option<&<Self as crate::HasSpec>::Spec> {
542 self.spec.as_ref()
543 }
544 fn spec_mut(&mut self) -> Option<&mut <Self as crate::HasSpec>::Spec> {
545 self.spec.as_mut()
546 }
547}
548impl crate::HasStatus for HorizontalPodAutoscaler {
549 type Status = crate::api::autoscaling::v2::HorizontalPodAutoscalerStatus;
550 fn status(&self) -> Option<&<Self as crate::HasStatus>::Status> {
551 self.status.as_ref()
552 }
553 fn status_mut(&mut self) -> Option<&mut <Self as crate::HasStatus>::Status> {
554 self.status.as_mut()
555 }
556}
557impl crate::HasConditions for HorizontalPodAutoscaler {
558 type Condition = crate::api::autoscaling::v2::HorizontalPodAutoscalerCondition;
559 fn conditions(&self) -> Option<&[<Self as crate::HasConditions>::Condition]> {
560 self.status.as_ref().map(|s| s.conditions.as_slice())
561 }
562 fn conditions_mut(&mut self) -> Option<&mut Vec<<Self as crate::HasConditions>::Condition>> {
563 self.status.as_mut().and_then(|s| Some(s.conditions.as_mut()))
564 }
565}