generated.proto 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. /*
  2. Copyright The Kubernetes Authors.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = "proto2";
  15. package k8s.io.api.autoscaling.v2beta1;
  16. import "k8s.io/api/core/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
  18. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  19. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  20. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  21. // Package-wide variables from generator "generated".
  22. option go_package = "k8s.io/api/autoscaling/v2beta1";
  23. // ContainerResourceMetricSource indicates how to scale on a resource metric known to
  24. // Kubernetes, as specified in requests and limits, describing each pod in the
  25. // current scale target (e.g. CPU or memory). The values will be averaged
  26. // together before being compared to the target. Such metrics are built in to
  27. // Kubernetes, and have special scaling options on top of those available to
  28. // normal per-pod metrics using the "pods" source. Only one "target" type
  29. // should be set.
  30. message ContainerResourceMetricSource {
  31. // name is the name of the resource in question.
  32. optional string name = 1;
  33. // targetAverageUtilization is the target value of the average of the
  34. // resource metric across all relevant pods, represented as a percentage of
  35. // the requested value of the resource for the pods.
  36. // +optional
  37. optional int32 targetAverageUtilization = 2;
  38. // targetAverageValue is the target value of the average of the
  39. // resource metric across all relevant pods, as a raw value (instead of as
  40. // a percentage of the request), similar to the "pods" metric source type.
  41. // +optional
  42. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
  43. // container is the name of the container in the pods of the scaling target
  44. optional string container = 4;
  45. }
  46. // ContainerResourceMetricStatus indicates the current value of a resource metric known to
  47. // Kubernetes, as specified in requests and limits, describing a single container in each pod in the
  48. // current scale target (e.g. CPU or memory). Such metrics are built in to
  49. // Kubernetes, and have special scaling options on top of those available to
  50. // normal per-pod metrics using the "pods" source.
  51. message ContainerResourceMetricStatus {
  52. // name is the name of the resource in question.
  53. optional string name = 1;
  54. // currentAverageUtilization is the current value of the average of the
  55. // resource metric across all relevant pods, represented as a percentage of
  56. // the requested value of the resource for the pods. It will only be
  57. // present if `targetAverageValue` was set in the corresponding metric
  58. // specification.
  59. // +optional
  60. optional int32 currentAverageUtilization = 2;
  61. // currentAverageValue is the current value of the average of the
  62. // resource metric across all relevant pods, as a raw value (instead of as
  63. // a percentage of the request), similar to the "pods" metric source type.
  64. // It will always be set, regardless of the corresponding metric specification.
  65. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
  66. // container is the name of the container in the pods of the scaling target
  67. optional string container = 4;
  68. }
  69. // CrossVersionObjectReference contains enough information to let you identify the referred resource.
  70. message CrossVersionObjectReference {
  71. // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  72. optional string kind = 1;
  73. // Name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  74. optional string name = 2;
  75. // API version of the referent
  76. // +optional
  77. optional string apiVersion = 3;
  78. }
  79. // ExternalMetricSource indicates how to scale on a metric not associated with
  80. // any Kubernetes object (for example length of queue in cloud
  81. // messaging service, or QPS from loadbalancer running outside of cluster).
  82. // Exactly one "target" type should be set.
  83. message ExternalMetricSource {
  84. // metricName is the name of the metric in question.
  85. optional string metricName = 1;
  86. // metricSelector is used to identify a specific time series
  87. // within a given metric.
  88. // +optional
  89. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
  90. // targetValue is the target value of the metric (as a quantity).
  91. // Mutually exclusive with TargetAverageValue.
  92. // +optional
  93. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
  94. // targetAverageValue is the target per-pod value of global metric (as a quantity).
  95. // Mutually exclusive with TargetValue.
  96. // +optional
  97. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
  98. }
  99. // ExternalMetricStatus indicates the current value of a global metric
  100. // not associated with any Kubernetes object.
  101. message ExternalMetricStatus {
  102. // metricName is the name of a metric used for autoscaling in
  103. // metric system.
  104. optional string metricName = 1;
  105. // metricSelector is used to identify a specific time series
  106. // within a given metric.
  107. // +optional
  108. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
  109. // currentValue is the current value of the metric (as a quantity)
  110. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
  111. // currentAverageValue is the current value of metric averaged over autoscaled pods.
  112. // +optional
  113. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
  114. }
  115. // HorizontalPodAutoscaler is the configuration for a horizontal pod
  116. // autoscaler, which automatically manages the replica count of any resource
  117. // implementing the scale subresource based on the metrics specified.
  118. message HorizontalPodAutoscaler {
  119. // metadata is the standard object metadata.
  120. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  121. // +optional
  122. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  123. // spec is the specification for the behaviour of the autoscaler.
  124. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
  125. // +optional
  126. optional HorizontalPodAutoscalerSpec spec = 2;
  127. // status is the current information about the autoscaler.
  128. // +optional
  129. optional HorizontalPodAutoscalerStatus status = 3;
  130. }
  131. // HorizontalPodAutoscalerCondition describes the state of
  132. // a HorizontalPodAutoscaler at a certain point.
  133. message HorizontalPodAutoscalerCondition {
  134. // type describes the current condition
  135. optional string type = 1;
  136. // status is the status of the condition (True, False, Unknown)
  137. optional string status = 2;
  138. // lastTransitionTime is the last time the condition transitioned from
  139. // one status to another
  140. // +optional
  141. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
  142. // reason is the reason for the condition's last transition.
  143. // +optional
  144. optional string reason = 4;
  145. // message is a human-readable explanation containing details about
  146. // the transition
  147. // +optional
  148. optional string message = 5;
  149. }
  150. // HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.
  151. message HorizontalPodAutoscalerList {
  152. // metadata is the standard list metadata.
  153. // +optional
  154. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  155. // items is the list of horizontal pod autoscaler objects.
  156. repeated HorizontalPodAutoscaler items = 2;
  157. }
  158. // HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
  159. message HorizontalPodAutoscalerSpec {
  160. // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
  161. // should be collected, as well as to actually change the replica count.
  162. optional CrossVersionObjectReference scaleTargetRef = 1;
  163. // minReplicas is the lower limit for the number of replicas to which the autoscaler
  164. // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
  165. // alpha feature gate HPAScaleToZero is enabled and at least one Object or External
  166. // metric is configured. Scaling is active as long as at least one metric value is
  167. // available.
  168. // +optional
  169. optional int32 minReplicas = 2;
  170. // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
  171. // It cannot be less that minReplicas.
  172. optional int32 maxReplicas = 3;
  173. // metrics contains the specifications for which to use to calculate the
  174. // desired replica count (the maximum replica count across all metrics will
  175. // be used). The desired replica count is calculated multiplying the
  176. // ratio between the target value and the current value by the current
  177. // number of pods. Ergo, metrics used must decrease as the pod count is
  178. // increased, and vice-versa. See the individual metric source types for
  179. // more information about how each type of metric must respond.
  180. // +optional
  181. repeated MetricSpec metrics = 4;
  182. }
  183. // HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
  184. message HorizontalPodAutoscalerStatus {
  185. // observedGeneration is the most recent generation observed by this autoscaler.
  186. // +optional
  187. optional int64 observedGeneration = 1;
  188. // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
  189. // used by the autoscaler to control how often the number of pods is changed.
  190. // +optional
  191. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
  192. // currentReplicas is current number of replicas of pods managed by this autoscaler,
  193. // as last seen by the autoscaler.
  194. optional int32 currentReplicas = 3;
  195. // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
  196. // as last calculated by the autoscaler.
  197. optional int32 desiredReplicas = 4;
  198. // currentMetrics is the last read state of the metrics used by this autoscaler.
  199. // +optional
  200. repeated MetricStatus currentMetrics = 5;
  201. // conditions is the set of conditions required for this autoscaler to scale its target,
  202. // and indicates whether or not those conditions are met.
  203. // +optional
  204. repeated HorizontalPodAutoscalerCondition conditions = 6;
  205. }
  206. // MetricSpec specifies how to scale based on a single metric
  207. // (only `type` and one other matching field should be set at once).
  208. message MetricSpec {
  209. // type is the type of metric source. It should be one of "ContainerResource",
  210. // "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object.
  211. // Note: "ContainerResource" type is available on when the feature-gate
  212. // HPAContainerMetrics is enabled
  213. optional string type = 1;
  214. // object refers to a metric describing a single kubernetes object
  215. // (for example, hits-per-second on an Ingress object).
  216. // +optional
  217. optional ObjectMetricSource object = 2;
  218. // pods refers to a metric describing each pod in the current scale target
  219. // (for example, transactions-processed-per-second). The values will be
  220. // averaged together before being compared to the target value.
  221. // +optional
  222. optional PodsMetricSource pods = 3;
  223. // resource refers to a resource metric (such as those specified in
  224. // requests and limits) known to Kubernetes describing each pod in the
  225. // current scale target (e.g. CPU or memory). Such metrics are built in to
  226. // Kubernetes, and have special scaling options on top of those available
  227. // to normal per-pod metrics using the "pods" source.
  228. // +optional
  229. optional ResourceMetricSource resource = 4;
  230. // container resource refers to a resource metric (such as those specified in
  231. // requests and limits) known to Kubernetes describing a single container in
  232. // each pod of the current scale target (e.g. CPU or memory). Such metrics are
  233. // built in to Kubernetes, and have special scaling options on top of those
  234. // available to normal per-pod metrics using the "pods" source.
  235. // This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
  236. // +optional
  237. optional ContainerResourceMetricSource containerResource = 7;
  238. // external refers to a global metric that is not associated
  239. // with any Kubernetes object. It allows autoscaling based on information
  240. // coming from components running outside of cluster
  241. // (for example length of queue in cloud messaging service, or
  242. // QPS from loadbalancer running outside of cluster).
  243. // +optional
  244. optional ExternalMetricSource external = 5;
  245. }
  246. // MetricStatus describes the last-read state of a single metric.
  247. message MetricStatus {
  248. // type is the type of metric source. It will be one of "ContainerResource",
  249. // "External", "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
  250. // Note: "ContainerResource" type is available on when the feature-gate
  251. // HPAContainerMetrics is enabled
  252. optional string type = 1;
  253. // object refers to a metric describing a single kubernetes object
  254. // (for example, hits-per-second on an Ingress object).
  255. // +optional
  256. optional ObjectMetricStatus object = 2;
  257. // pods refers to a metric describing each pod in the current scale target
  258. // (for example, transactions-processed-per-second). The values will be
  259. // averaged together before being compared to the target value.
  260. // +optional
  261. optional PodsMetricStatus pods = 3;
  262. // resource refers to a resource metric (such as those specified in
  263. // requests and limits) known to Kubernetes describing each pod in the
  264. // current scale target (e.g. CPU or memory). Such metrics are built in to
  265. // Kubernetes, and have special scaling options on top of those available
  266. // to normal per-pod metrics using the "pods" source.
  267. // +optional
  268. optional ResourceMetricStatus resource = 4;
  269. // container resource refers to a resource metric (such as those specified in
  270. // requests and limits) known to Kubernetes describing a single container in each pod in the
  271. // current scale target (e.g. CPU or memory). Such metrics are built in to
  272. // Kubernetes, and have special scaling options on top of those available
  273. // to normal per-pod metrics using the "pods" source.
  274. // +optional
  275. optional ContainerResourceMetricStatus containerResource = 7;
  276. // external refers to a global metric that is not associated
  277. // with any Kubernetes object. It allows autoscaling based on information
  278. // coming from components running outside of cluster
  279. // (for example length of queue in cloud messaging service, or
  280. // QPS from loadbalancer running outside of cluster).
  281. // +optional
  282. optional ExternalMetricStatus external = 5;
  283. }
  284. // ObjectMetricSource indicates how to scale on a metric describing a
  285. // kubernetes object (for example, hits-per-second on an Ingress object).
  286. message ObjectMetricSource {
  287. // target is the described Kubernetes object.
  288. optional CrossVersionObjectReference target = 1;
  289. // metricName is the name of the metric in question.
  290. optional string metricName = 2;
  291. // targetValue is the target value of the metric (as a quantity).
  292. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
  293. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  294. // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
  295. // When unset, just the metricName will be used to gather metrics.
  296. // +optional
  297. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  298. // averageValue is the target value of the average of the
  299. // metric across all relevant pods (as a quantity)
  300. // +optional
  301. optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
  302. }
  303. // ObjectMetricStatus indicates the current value of a metric describing a
  304. // kubernetes object (for example, hits-per-second on an Ingress object).
  305. message ObjectMetricStatus {
  306. // target is the described Kubernetes object.
  307. optional CrossVersionObjectReference target = 1;
  308. // metricName is the name of the metric in question.
  309. optional string metricName = 2;
  310. // currentValue is the current value of the metric (as a quantity).
  311. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
  312. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  313. // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
  314. // When unset, just the metricName will be used to gather metrics.
  315. // +optional
  316. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  317. // averageValue is the current value of the average of the
  318. // metric across all relevant pods (as a quantity)
  319. // +optional
  320. optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
  321. }
  322. // PodsMetricSource indicates how to scale on a metric describing each pod in
  323. // the current scale target (for example, transactions-processed-per-second).
  324. // The values will be averaged together before being compared to the target
  325. // value.
  326. message PodsMetricSource {
  327. // metricName is the name of the metric in question
  328. optional string metricName = 1;
  329. // targetAverageValue is the target value of the average of the
  330. // metric across all relevant pods (as a quantity)
  331. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
  332. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  333. // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
  334. // When unset, just the metricName will be used to gather metrics.
  335. // +optional
  336. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
  337. }
  338. // PodsMetricStatus indicates the current value of a metric describing each pod in
  339. // the current scale target (for example, transactions-processed-per-second).
  340. message PodsMetricStatus {
  341. // metricName is the name of the metric in question
  342. optional string metricName = 1;
  343. // currentAverageValue is the current value of the average of the
  344. // metric across all relevant pods (as a quantity)
  345. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
  346. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  347. // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
  348. // When unset, just the metricName will be used to gather metrics.
  349. // +optional
  350. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
  351. }
  352. // ResourceMetricSource indicates how to scale on a resource metric known to
  353. // Kubernetes, as specified in requests and limits, describing each pod in the
  354. // current scale target (e.g. CPU or memory). The values will be averaged
  355. // together before being compared to the target. Such metrics are built in to
  356. // Kubernetes, and have special scaling options on top of those available to
  357. // normal per-pod metrics using the "pods" source. Only one "target" type
  358. // should be set.
  359. message ResourceMetricSource {
  360. // name is the name of the resource in question.
  361. optional string name = 1;
  362. // targetAverageUtilization is the target value of the average of the
  363. // resource metric across all relevant pods, represented as a percentage of
  364. // the requested value of the resource for the pods.
  365. // +optional
  366. optional int32 targetAverageUtilization = 2;
  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. // ResourceMetricStatus indicates the current value of a resource metric known to
  374. // Kubernetes, as specified in requests and limits, describing each pod in the
  375. // current scale target (e.g. CPU or memory). Such metrics are built in to
  376. // Kubernetes, and have special scaling options on top of those available to
  377. // normal per-pod metrics using the "pods" source.
  378. message ResourceMetricStatus {
  379. // name is the name of the resource in question.
  380. optional string name = 1;
  381. // currentAverageUtilization is the current value of the average of the
  382. // resource metric across all relevant pods, represented as a percentage of
  383. // the requested value of the resource for the pods. It will only be
  384. // present if `targetAverageValue` was set in the corresponding metric
  385. // specification.
  386. // +optional
  387. optional int32 currentAverageUtilization = 2;
  388. // currentAverageValue is the current value of the average of the
  389. // resource metric across all relevant pods, as a raw value (instead of as
  390. // a percentage of the request), similar to the "pods" metric source type.
  391. // It will always be set, regardless of the corresponding metric specification.
  392. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
  393. }