generated.proto 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  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.v2beta2;
  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/v2beta2";
  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. // target specifies the target value for the given metric
  34. optional MetricTarget target = 2;
  35. // container is the name of the container in the pods of the scaling target
  36. optional string container = 3;
  37. }
  38. // ContainerResourceMetricStatus indicates the current value of a resource metric known to
  39. // Kubernetes, as specified in requests and limits, describing a single container in each pod in the
  40. // current scale target (e.g. CPU or memory). Such metrics are built in to
  41. // Kubernetes, and have special scaling options on top of those available to
  42. // normal per-pod metrics using the "pods" source.
  43. message ContainerResourceMetricStatus {
  44. // name is the name of the resource in question.
  45. optional string name = 1;
  46. // current contains the current value for the given metric
  47. optional MetricValueStatus current = 2;
  48. // container is the name of the container in the pods of the scaling target
  49. optional string container = 3;
  50. }
  51. // CrossVersionObjectReference contains enough information to let you identify the referred resource.
  52. message CrossVersionObjectReference {
  53. // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  54. optional string kind = 1;
  55. // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  56. optional string name = 2;
  57. // apiVersion is the API version of the referent
  58. // +optional
  59. optional string apiVersion = 3;
  60. }
  61. // ExternalMetricSource indicates how to scale on a metric not associated with
  62. // any Kubernetes object (for example length of queue in cloud
  63. // messaging service, or QPS from loadbalancer running outside of cluster).
  64. message ExternalMetricSource {
  65. // metric identifies the target metric by name and selector
  66. optional MetricIdentifier metric = 1;
  67. // target specifies the target value for the given metric
  68. optional MetricTarget target = 2;
  69. }
  70. // ExternalMetricStatus indicates the current value of a global metric
  71. // not associated with any Kubernetes object.
  72. message ExternalMetricStatus {
  73. // metric identifies the target metric by name and selector
  74. optional MetricIdentifier metric = 1;
  75. // current contains the current value for the given metric
  76. optional MetricValueStatus current = 2;
  77. }
  78. // HPAScalingPolicy is a single policy which must hold true for a specified past interval.
  79. message HPAScalingPolicy {
  80. // type is used to specify the scaling policy.
  81. optional string type = 1;
  82. // value contains the amount of change which is permitted by the policy.
  83. // It must be greater than zero
  84. optional int32 value = 2;
  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. optional int32 periodSeconds = 3;
  88. }
  89. // HPAScalingRules configures the scaling behavior for one direction.
  90. // These Rules are applied after calculating DesiredReplicas from metrics for the HPA.
  91. // They can limit the scaling velocity by specifying scaling policies.
  92. // They can prevent flapping by specifying the stabilization window, so that the
  93. // number of replicas is not set instantly, instead, the safest value from the stabilization
  94. // window is chosen.
  95. message HPAScalingRules {
  96. // stabilizationWindowSeconds is the number of seconds for which past recommendations should be
  97. // considered while scaling up or scaling down.
  98. // StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour).
  99. // If not set, use the default values:
  100. // - For scale up: 0 (i.e. no stabilization is done).
  101. // - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
  102. // +optional
  103. optional int32 stabilizationWindowSeconds = 3;
  104. // selectPolicy is used to specify which policy should be used.
  105. // If not set, the default value MaxPolicySelect is used.
  106. // +optional
  107. optional string selectPolicy = 1;
  108. // policies is a list of potential scaling polices which can be used during scaling.
  109. // At least one policy must be specified, otherwise the HPAScalingRules will be discarded as invalid
  110. // +optional
  111. // +listType=atomic
  112. repeated HPAScalingPolicy policies = 2;
  113. }
  114. // HorizontalPodAutoscaler is the configuration for a horizontal pod
  115. // autoscaler, which automatically manages the replica count of any resource
  116. // implementing the scale subresource based on the metrics specified.
  117. message HorizontalPodAutoscaler {
  118. // metadata is the standard object metadata.
  119. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  120. // +optional
  121. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  122. // spec is the specification for the behaviour of the autoscaler.
  123. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
  124. // +optional
  125. optional HorizontalPodAutoscalerSpec spec = 2;
  126. // status is the current information about the autoscaler.
  127. // +optional
  128. optional HorizontalPodAutoscalerStatus status = 3;
  129. }
  130. // HorizontalPodAutoscalerBehavior configures the scaling behavior of the target
  131. // in both Up and Down directions (scaleUp and scaleDown fields respectively).
  132. message HorizontalPodAutoscalerBehavior {
  133. // scaleUp is scaling policy for scaling Up.
  134. // If not set, the default value is the higher of:
  135. // * increase no more than 4 pods per 60 seconds
  136. // * double the number of pods per 60 seconds
  137. // No stabilization is used.
  138. // +optional
  139. optional HPAScalingRules scaleUp = 1;
  140. // scaleDown is scaling policy for scaling Down.
  141. // If not set, the default value is to allow to scale down to minReplicas pods, with a
  142. // 300 second stabilization window (i.e., the highest recommendation for
  143. // the last 300sec is used).
  144. // +optional
  145. optional HPAScalingRules scaleDown = 2;
  146. }
  147. // HorizontalPodAutoscalerCondition describes the state of
  148. // a HorizontalPodAutoscaler at a certain point.
  149. message HorizontalPodAutoscalerCondition {
  150. // type describes the current condition
  151. optional string type = 1;
  152. // status is the status of the condition (True, False, Unknown)
  153. optional string status = 2;
  154. // lastTransitionTime is the last time the condition transitioned from
  155. // one status to another
  156. // +optional
  157. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
  158. // reason is the reason for the condition's last transition.
  159. // +optional
  160. optional string reason = 4;
  161. // message is a human-readable explanation containing details about
  162. // the transition
  163. // +optional
  164. optional string message = 5;
  165. }
  166. // HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.
  167. message HorizontalPodAutoscalerList {
  168. // metadata is the standard list metadata.
  169. // +optional
  170. optional .k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  171. // items is the list of horizontal pod autoscaler objects.
  172. repeated HorizontalPodAutoscaler items = 2;
  173. }
  174. // HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
  175. message HorizontalPodAutoscalerSpec {
  176. // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
  177. // should be collected, as well as to actually change the replica count.
  178. optional CrossVersionObjectReference scaleTargetRef = 1;
  179. // minReplicas is the lower limit for the number of replicas to which the autoscaler
  180. // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
  181. // alpha feature gate HPAScaleToZero is enabled and at least one Object or External
  182. // metric is configured. Scaling is active as long as at least one metric value is
  183. // available.
  184. // +optional
  185. optional int32 minReplicas = 2;
  186. // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
  187. // It cannot be less that minReplicas.
  188. optional int32 maxReplicas = 3;
  189. // metrics contains the specifications for which to use to calculate the
  190. // desired replica count (the maximum replica count across all metrics will
  191. // be used). The desired replica count is calculated multiplying the
  192. // ratio between the target value and the current value by the current
  193. // number of pods. Ergo, metrics used must decrease as the pod count is
  194. // increased, and vice-versa. See the individual metric source types for
  195. // more information about how each type of metric must respond.
  196. // If not set, the default metric will be set to 80% average CPU utilization.
  197. // +optional
  198. // +listType=atomic
  199. repeated MetricSpec metrics = 4;
  200. // behavior configures the scaling behavior of the target
  201. // in both Up and Down directions (scaleUp and scaleDown fields respectively).
  202. // If not set, the default HPAScalingRules for scale up and scale down are used.
  203. // +optional
  204. optional HorizontalPodAutoscalerBehavior behavior = 5;
  205. }
  206. // HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
  207. message HorizontalPodAutoscalerStatus {
  208. // observedGeneration is the most recent generation observed by this autoscaler.
  209. // +optional
  210. optional int64 observedGeneration = 1;
  211. // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
  212. // used by the autoscaler to control how often the number of pods is changed.
  213. // +optional
  214. optional .k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
  215. // currentReplicas is current number of replicas of pods managed by this autoscaler,
  216. // as last seen by the autoscaler.
  217. optional int32 currentReplicas = 3;
  218. // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
  219. // as last calculated by the autoscaler.
  220. optional int32 desiredReplicas = 4;
  221. // currentMetrics is the last read state of the metrics used by this autoscaler.
  222. // +optional
  223. // +listType=atomic
  224. repeated MetricStatus currentMetrics = 5;
  225. // conditions is the set of conditions required for this autoscaler to scale its target,
  226. // and indicates whether or not those conditions are met.
  227. // +optional
  228. // +listType=atomic
  229. repeated HorizontalPodAutoscalerCondition conditions = 6;
  230. }
  231. // MetricIdentifier defines the name and optionally selector for a metric
  232. message MetricIdentifier {
  233. // name is the name of the given metric
  234. optional string name = 1;
  235. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  236. // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
  237. // When unset, just the metricName will be used to gather metrics.
  238. // +optional
  239. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 2;
  240. }
  241. // MetricSpec specifies how to scale based on a single metric
  242. // (only `type` and one other matching field should be set at once).
  243. message MetricSpec {
  244. // type is the type of metric source. It should be one of "ContainerResource", "External",
  245. // "Object", "Pods" or "Resource", each mapping to a matching field in the object.
  246. optional string type = 1;
  247. // object refers to a metric describing a single kubernetes object
  248. // (for example, hits-per-second on an Ingress object).
  249. // +optional
  250. optional ObjectMetricSource object = 2;
  251. // pods refers to a metric describing each pod in the current scale target
  252. // (for example, transactions-processed-per-second). The values will be
  253. // averaged together before being compared to the target value.
  254. // +optional
  255. optional PodsMetricSource pods = 3;
  256. // resource refers to a resource metric (such as those specified in
  257. // requests and limits) known to Kubernetes describing each pod in the
  258. // current scale target (e.g. CPU or memory). Such metrics are built in to
  259. // Kubernetes, and have special scaling options on top of those available
  260. // to normal per-pod metrics using the "pods" source.
  261. // +optional
  262. optional ResourceMetricSource resource = 4;
  263. // container resource refers to a resource metric (such as those specified in
  264. // requests and limits) known to Kubernetes describing a single container in
  265. // each pod of the current scale target (e.g. CPU or memory). Such metrics are
  266. // built in to Kubernetes, and have special scaling options on top of those
  267. // available to normal per-pod metrics using the "pods" source.
  268. // +optional
  269. optional ContainerResourceMetricSource containerResource = 7;
  270. // external refers to a global metric that is not associated
  271. // with any Kubernetes object. It allows autoscaling based on information
  272. // coming from components running outside of cluster
  273. // (for example length of queue in cloud messaging service, or
  274. // QPS from loadbalancer running outside of cluster).
  275. // +optional
  276. optional ExternalMetricSource external = 5;
  277. }
  278. // MetricStatus describes the last-read state of a single metric.
  279. message MetricStatus {
  280. // type is the type of metric source. It will be one of "ContainerResource", "External",
  281. // "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
  282. optional string type = 1;
  283. // object refers to a metric describing a single kubernetes object
  284. // (for example, hits-per-second on an Ingress object).
  285. // +optional
  286. optional ObjectMetricStatus object = 2;
  287. // pods refers to a metric describing each pod in the current scale target
  288. // (for example, transactions-processed-per-second). The values will be
  289. // averaged together before being compared to the target value.
  290. // +optional
  291. optional PodsMetricStatus pods = 3;
  292. // resource refers to a resource metric (such as those specified in
  293. // requests and limits) known to Kubernetes describing each pod in the
  294. // current scale target (e.g. CPU or memory). Such metrics are built in to
  295. // Kubernetes, and have special scaling options on top of those available
  296. // to normal per-pod metrics using the "pods" source.
  297. // +optional
  298. optional ResourceMetricStatus resource = 4;
  299. // containerResource refers to a resource metric (such as those specified in
  300. // requests and limits) known to Kubernetes describing a single container in each pod in the
  301. // current scale target (e.g. CPU or memory). Such metrics are built in to
  302. // Kubernetes, and have special scaling options on top of those available
  303. // to normal per-pod metrics using the "pods" source.
  304. // +optional
  305. optional ContainerResourceMetricStatus containerResource = 7;
  306. // external refers to a global metric that is not associated
  307. // with any Kubernetes object. It allows autoscaling based on information
  308. // coming from components running outside of cluster
  309. // (for example length of queue in cloud messaging service, or
  310. // QPS from loadbalancer running outside of cluster).
  311. // +optional
  312. optional ExternalMetricStatus external = 5;
  313. }
  314. // MetricTarget defines the target value, average value, or average utilization of a specific metric
  315. message MetricTarget {
  316. // type represents whether the metric type is Utilization, Value, or AverageValue
  317. optional string type = 1;
  318. // value is the target value of the metric (as a quantity).
  319. // +optional
  320. optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 2;
  321. // averageValue is the target value of the average of the
  322. // metric across all relevant pods (as a quantity)
  323. // +optional
  324. optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 3;
  325. // averageUtilization is the target value of the average of the
  326. // resource metric across all relevant pods, represented as a percentage of
  327. // the requested value of the resource for the pods.
  328. // Currently only valid for Resource metric source type
  329. // +optional
  330. optional int32 averageUtilization = 4;
  331. }
  332. // MetricValueStatus holds the current value for a metric
  333. message MetricValueStatus {
  334. // value is the current value of the metric (as a quantity).
  335. // +optional
  336. optional .k8s.io.apimachinery.pkg.api.resource.Quantity value = 1;
  337. // averageValue is the current value of the average of the
  338. // metric across all relevant pods (as a quantity)
  339. // +optional
  340. optional .k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 2;
  341. // averageUtilization is the current value of the average of the
  342. // resource metric across all relevant pods, represented as a percentage of
  343. // the requested value of the resource for the pods.
  344. // +optional
  345. optional int32 averageUtilization = 3;
  346. }
  347. // ObjectMetricSource indicates how to scale on a metric describing a
  348. // kubernetes object (for example, hits-per-second on an Ingress object).
  349. message ObjectMetricSource {
  350. optional CrossVersionObjectReference describedObject = 1;
  351. // target specifies the target value for the given metric
  352. optional MetricTarget target = 2;
  353. // metric identifies the target metric by name and selector
  354. optional MetricIdentifier metric = 3;
  355. }
  356. // ObjectMetricStatus indicates the current value of a metric describing a
  357. // kubernetes object (for example, hits-per-second on an Ingress object).
  358. message ObjectMetricStatus {
  359. // metric identifies the target metric by name and selector
  360. optional MetricIdentifier metric = 1;
  361. // current contains the current value for the given metric
  362. optional MetricValueStatus current = 2;
  363. optional CrossVersionObjectReference describedObject = 3;
  364. }
  365. // PodsMetricSource indicates how to scale on a metric describing each pod in
  366. // the current scale target (for example, transactions-processed-per-second).
  367. // The values will be averaged together before being compared to the target
  368. // value.
  369. message PodsMetricSource {
  370. // metric identifies the target metric by name and selector
  371. optional MetricIdentifier metric = 1;
  372. // target specifies the target value for the given metric
  373. optional MetricTarget target = 2;
  374. }
  375. // PodsMetricStatus indicates the current value of a metric describing each pod in
  376. // the current scale target (for example, transactions-processed-per-second).
  377. message PodsMetricStatus {
  378. // metric identifies the target metric by name and selector
  379. optional MetricIdentifier metric = 1;
  380. // current contains the current value for the given metric
  381. optional MetricValueStatus current = 2;
  382. }
  383. // ResourceMetricSource indicates how to scale on a resource metric known to
  384. // Kubernetes, as specified in requests and limits, describing each pod in the
  385. // current scale target (e.g. CPU or memory). The values will be averaged
  386. // together before being compared to the target. Such metrics are built in to
  387. // Kubernetes, and have special scaling options on top of those available to
  388. // normal per-pod metrics using the "pods" source. Only one "target" type
  389. // should be set.
  390. message ResourceMetricSource {
  391. // name is the name of the resource in question.
  392. optional string name = 1;
  393. // target specifies the target value for the given metric
  394. optional MetricTarget target = 2;
  395. }
  396. // ResourceMetricStatus indicates the current value of a resource metric known to
  397. // Kubernetes, as specified in requests and limits, describing each pod in the
  398. // current scale target (e.g. CPU or memory). Such metrics are built in to
  399. // Kubernetes, and have special scaling options on top of those available to
  400. // normal per-pod metrics using the "pods" source.
  401. message ResourceMetricStatus {
  402. // name is the name of the resource in question.
  403. optional string name = 1;
  404. // current contains the current value for the given metric
  405. optional MetricValueStatus current = 2;
  406. }