generated.proto 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  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.v1;
  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 = "v1";
  23. // ContainerResourceMetricSource indicates how to scale on a resource metric known to
  24. // Kubernetes, as specified in the requests and limits, describing a single container in
  25. // each of the pods of the current scale target(e.g. CPU or memory). The values will be
  26. // averaged together before being compared to the target. Such metrics are built into
  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 = 5;
  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 taget
  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: http://kubernetes.io/docs/user-guide/identifiers#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. message ExternalMetricSource {
  83. // metricName is the name of the metric in question.
  84. optional string metricName = 1;
  85. // metricSelector is used to identify a specific time series
  86. // within a given metric.
  87. // +optional
  88. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
  89. // targetValue is the target value of the metric (as a quantity).
  90. // Mutually exclusive with TargetAverageValue.
  91. // +optional
  92. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
  93. // targetAverageValue is the target per-pod value of global metric (as a quantity).
  94. // Mutually exclusive with TargetValue.
  95. // +optional
  96. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
  97. }
  98. // ExternalMetricStatus indicates the current value of a global metric
  99. // not associated with any Kubernetes object.
  100. message ExternalMetricStatus {
  101. // metricName is the name of a metric used for autoscaling in
  102. // metric system.
  103. optional string metricName = 1;
  104. // metricSelector is used to identify a specific time series
  105. // within a given metric.
  106. // +optional
  107. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
  108. // currentValue is the current value of the metric (as a quantity)
  109. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
  110. // currentAverageValue is the current value of metric averaged over autoscaled pods.
  111. // +optional
  112. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
  113. }
  114. // configuration of a horizontal pod autoscaler.
  115. message HorizontalPodAutoscaler {
  116. // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
  117. // +optional
  118. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  119. // behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
  120. // +optional
  121. optional HorizontalPodAutoscalerSpec spec = 2;
  122. // current information about the autoscaler.
  123. // +optional
  124. optional HorizontalPodAutoscalerStatus status = 3;
  125. }
  126. // HorizontalPodAutoscalerCondition describes the state of
  127. // a HorizontalPodAutoscaler at a certain point.
  128. message HorizontalPodAutoscalerCondition {
  129. // type describes the current condition
  130. optional string type = 1;
  131. // status is the status of the condition (True, False, Unknown)
  132. optional string status = 2;
  133. // lastTransitionTime is the last time the condition transitioned from
  134. // one status to another
  135. // +optional
  136. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
  137. // reason is the reason for the condition's last transition.
  138. // +optional
  139. optional string reason = 4;
  140. // message is a human-readable explanation containing details about
  141. // the transition
  142. // +optional
  143. optional string message = 5;
  144. }
  145. // list of horizontal pod autoscaler objects.
  146. message HorizontalPodAutoscalerList {
  147. // Standard list metadata.
  148. // +optional
  149. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  150. // list of horizontal pod autoscaler objects.
  151. repeated HorizontalPodAutoscaler items = 2;
  152. }
  153. // specification of a horizontal pod autoscaler.
  154. message HorizontalPodAutoscalerSpec {
  155. // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
  156. // and will set the desired number of pods by using its Scale subresource.
  157. optional CrossVersionObjectReference scaleTargetRef = 1;
  158. // minReplicas is the lower limit for the number of replicas to which the autoscaler
  159. // can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the
  160. // alpha feature gate HPAScaleToZero is enabled and at least one Object or External
  161. // metric is configured. Scaling is active as long as at least one metric value is
  162. // available.
  163. // +optional
  164. optional int32 minReplicas = 2;
  165. // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
  166. optional int32 maxReplicas = 3;
  167. // target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
  168. // if not specified the default autoscaling policy will be used.
  169. // +optional
  170. optional int32 targetCPUUtilizationPercentage = 4;
  171. }
  172. // current status of a horizontal pod autoscaler
  173. message HorizontalPodAutoscalerStatus {
  174. // most recent generation observed by this autoscaler.
  175. // +optional
  176. optional int64 observedGeneration = 1;
  177. // last time the HorizontalPodAutoscaler scaled the number of pods;
  178. // used by the autoscaler to control how often the number of pods is changed.
  179. // +optional
  180. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
  181. // current number of replicas of pods managed by this autoscaler.
  182. optional int32 currentReplicas = 3;
  183. // desired number of replicas of pods managed by this autoscaler.
  184. optional int32 desiredReplicas = 4;
  185. // current average CPU utilization over all pods, represented as a percentage of requested CPU,
  186. // e.g. 70 means that an average pod is using now 70% of its requested CPU.
  187. // +optional
  188. optional int32 currentCPUUtilizationPercentage = 5;
  189. }
  190. // MetricSpec specifies how to scale based on a single metric
  191. // (only `type` and one other matching field should be set at once).
  192. message MetricSpec {
  193. // type is the type of metric source. It should be one of "ContainerResource",
  194. // "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object.
  195. // Note: "ContainerResource" type is available on when the feature-gate
  196. // HPAContainerMetrics is enabled
  197. optional string type = 1;
  198. // object refers to a metric describing a single kubernetes object
  199. // (for example, hits-per-second on an Ingress object).
  200. // +optional
  201. optional ObjectMetricSource object = 2;
  202. // pods refers to a metric describing each pod in the current scale target
  203. // (for example, transactions-processed-per-second). The values will be
  204. // averaged together before being compared to the target value.
  205. // +optional
  206. optional PodsMetricSource pods = 3;
  207. // resource refers to a resource metric (such as those specified in
  208. // requests and limits) known to Kubernetes describing each pod in the
  209. // current scale target (e.g. CPU or memory). Such metrics are built in to
  210. // Kubernetes, and have special scaling options on top of those available
  211. // to normal per-pod metrics using the "pods" source.
  212. // +optional
  213. optional ResourceMetricSource resource = 4;
  214. // container resource refers to a resource metric (such as those specified in
  215. // requests and limits) known to Kubernetes describing a single container in each pod of the
  216. // current scale target (e.g. CPU or memory). Such metrics are built in to
  217. // Kubernetes, and have special scaling options on top of those available
  218. // to normal per-pod metrics using the "pods" source.
  219. // This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
  220. // +optional
  221. optional ContainerResourceMetricSource containerResource = 7;
  222. // external refers to a global metric that is not associated
  223. // with any Kubernetes object. It allows autoscaling based on information
  224. // coming from components running outside of cluster
  225. // (for example length of queue in cloud messaging service, or
  226. // QPS from loadbalancer running outside of cluster).
  227. // +optional
  228. optional ExternalMetricSource external = 5;
  229. }
  230. // MetricStatus describes the last-read state of a single metric.
  231. message MetricStatus {
  232. // type is the type of metric source. It will be one of "ContainerResource",
  233. // "External", "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
  234. // Note: "ContainerResource" type is available on when the feature-gate
  235. // HPAContainerMetrics is enabled
  236. optional string type = 1;
  237. // object refers to a metric describing a single kubernetes object
  238. // (for example, hits-per-second on an Ingress object).
  239. // +optional
  240. optional ObjectMetricStatus object = 2;
  241. // pods refers to a metric describing each pod in the current scale target
  242. // (for example, transactions-processed-per-second). The values will be
  243. // averaged together before being compared to the target value.
  244. // +optional
  245. optional PodsMetricStatus pods = 3;
  246. // resource refers to a resource metric (such as those specified in
  247. // requests and limits) known to Kubernetes describing each pod in the
  248. // current scale target (e.g. CPU or memory). Such metrics are built in to
  249. // Kubernetes, and have special scaling options on top of those available
  250. // to normal per-pod metrics using the "pods" source.
  251. // +optional
  252. optional ResourceMetricStatus resource = 4;
  253. // container resource refers to a resource metric (such as those specified in
  254. // requests and limits) known to Kubernetes describing a single container in each pod in the
  255. // current scale target (e.g. CPU or memory). Such metrics are built in to
  256. // Kubernetes, and have special scaling options on top of those available
  257. // to normal per-pod metrics using the "pods" source.
  258. // +optional
  259. optional ContainerResourceMetricStatus containerResource = 7;
  260. // external refers to a global metric that is not associated
  261. // with any Kubernetes object. It allows autoscaling based on information
  262. // coming from components running outside of cluster
  263. // (for example length of queue in cloud messaging service, or
  264. // QPS from loadbalancer running outside of cluster).
  265. // +optional
  266. optional ExternalMetricStatus external = 5;
  267. }
  268. // ObjectMetricSource indicates how to scale on a metric describing a
  269. // kubernetes object (for example, hits-per-second on an Ingress object).
  270. message ObjectMetricSource {
  271. // target is the described Kubernetes object.
  272. optional CrossVersionObjectReference target = 1;
  273. // metricName is the name of the metric in question.
  274. optional string metricName = 2;
  275. // targetValue is the target value of the metric (as a quantity).
  276. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
  277. // selector is the string-encoded form of a standard kubernetes label selector for the given metric.
  278. // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
  279. // When unset, just the metricName will be used to gather metrics.
  280. // +optional
  281. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  282. // averageValue is the target value of the average of the
  283. // metric across all relevant pods (as a quantity)
  284. // +optional
  285. optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
  286. }
  287. // ObjectMetricStatus indicates the current value of a metric describing a
  288. // kubernetes object (for example, hits-per-second on an Ingress object).
  289. message ObjectMetricStatus {
  290. // target is the described Kubernetes object.
  291. optional CrossVersionObjectReference target = 1;
  292. // metricName is the name of the metric in question.
  293. optional string metricName = 2;
  294. // currentValue is the current value of the metric (as a quantity).
  295. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
  296. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  297. // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
  298. // When unset, just the metricName will be used to gather metrics.
  299. // +optional
  300. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  301. // averageValue is the current value of the average of the
  302. // metric across all relevant pods (as a quantity)
  303. // +optional
  304. optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
  305. }
  306. // PodsMetricSource indicates how to scale on a metric describing each pod in
  307. // the current scale target (for example, transactions-processed-per-second).
  308. // The values will be averaged together before being compared to the target
  309. // value.
  310. message PodsMetricSource {
  311. // metricName is the name of the metric in question
  312. optional string metricName = 1;
  313. // targetAverageValue is the target value of the average of the
  314. // metric across all relevant pods (as a quantity)
  315. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
  316. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  317. // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
  318. // When unset, just the metricName will be used to gather metrics.
  319. // +optional
  320. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
  321. }
  322. // PodsMetricStatus indicates the current value of a metric describing each pod in
  323. // the current scale target (for example, transactions-processed-per-second).
  324. message PodsMetricStatus {
  325. // metricName is the name of the metric in question
  326. optional string metricName = 1;
  327. // currentAverageValue is the current value of the average of the
  328. // metric across all relevant pods (as a quantity)
  329. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
  330. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  331. // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
  332. // When unset, just the metricName will be used to gather metrics.
  333. // +optional
  334. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
  335. }
  336. // ResourceMetricSource indicates how to scale on a resource metric known to
  337. // Kubernetes, as specified in requests and limits, describing each pod in the
  338. // current scale target (e.g. CPU or memory). The values will be averaged
  339. // together before being compared to the target. Such metrics are built in to
  340. // Kubernetes, and have special scaling options on top of those available to
  341. // normal per-pod metrics using the "pods" source. Only one "target" type
  342. // should be set.
  343. message ResourceMetricSource {
  344. // name is the name of the resource in question.
  345. optional string name = 1;
  346. // targetAverageUtilization is the target value of the average of the
  347. // resource metric across all relevant pods, represented as a percentage of
  348. // the requested value of the resource for the pods.
  349. // +optional
  350. optional int32 targetAverageUtilization = 2;
  351. // targetAverageValue is the target value of the average of the
  352. // resource metric across all relevant pods, as a raw value (instead of as
  353. // a percentage of the request), similar to the "pods" metric source type.
  354. // +optional
  355. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
  356. }
  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;
  365. // currentAverageUtilization is the current value of the average of the
  366. // resource metric across all relevant pods, represented as a percentage of
  367. // the requested value of the resource for the pods. It will only be
  368. // present if `targetAverageValue` was set in the corresponding metric
  369. // specification.
  370. // +optional
  371. optional int32 currentAverageUtilization = 2;
  372. // currentAverageValue is the current value of the average of the
  373. // resource metric across all relevant pods, as a raw value (instead of as
  374. // a percentage of the request), similar to the "pods" metric source type.
  375. // It will always be set, regardless of the corresponding metric specification.
  376. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
  377. }
  378. // Scale represents a scaling request for a resource.
  379. message Scale {
  380. // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
  381. // +optional
  382. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  383. // defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
  384. // +optional
  385. optional ScaleSpec spec = 2;
  386. // current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.
  387. // +optional
  388. optional ScaleStatus status = 3;
  389. }
  390. // ScaleSpec describes the attributes of a scale subresource.
  391. message ScaleSpec {
  392. // desired number of instances for the scaled object.
  393. // +optional
  394. optional int32 replicas = 1;
  395. }
  396. // ScaleStatus represents the current status of a scale subresource.
  397. message ScaleStatus {
  398. // actual number of observed instances of the scaled object.
  399. optional int32 replicas = 1;
  400. // label query over pods that should match the replicas count. This is same
  401. // as the label selector but in the string format to avoid introspection
  402. // by clients. The string will be in the same format as the query-param syntax.
  403. // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors
  404. // +optional
  405. optional string selector = 2;
  406. }