generated.proto 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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 = "v2beta1";
  23. // CrossVersionObjectReference contains enough information to let you identify the referred resource.
  24. message CrossVersionObjectReference {
  25. // Kind of the referent; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds"
  26. optional string kind = 1;
  27. // Name of the referent; More info: http://kubernetes.io/docs/user-guide/identifiers#names
  28. optional string name = 2;
  29. // API version of the referent
  30. // +optional
  31. optional string apiVersion = 3;
  32. }
  33. // ExternalMetricSource indicates how to scale on a metric not associated with
  34. // any Kubernetes object (for example length of queue in cloud
  35. // messaging service, or QPS from loadbalancer running outside of cluster).
  36. // Exactly one "target" type should be set.
  37. message ExternalMetricSource {
  38. // metricName is the name of the metric in question.
  39. optional string metricName = 1;
  40. // metricSelector is used to identify a specific time series
  41. // within a given metric.
  42. // +optional
  43. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
  44. // targetValue is the target value of the metric (as a quantity).
  45. // Mutually exclusive with TargetAverageValue.
  46. // +optional
  47. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
  48. // targetAverageValue is the target per-pod value of global metric (as a quantity).
  49. // Mutually exclusive with TargetValue.
  50. // +optional
  51. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
  52. }
  53. // ExternalMetricStatus indicates the current value of a global metric
  54. // not associated with any Kubernetes object.
  55. message ExternalMetricStatus {
  56. // metricName is the name of a metric used for autoscaling in
  57. // metric system.
  58. optional string metricName = 1;
  59. // metricSelector is used to identify a specific time series
  60. // within a given metric.
  61. // +optional
  62. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
  63. // currentValue is the current value of the metric (as a quantity)
  64. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
  65. // currentAverageValue is the current value of metric averaged over autoscaled pods.
  66. // +optional
  67. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
  68. }
  69. // HorizontalPodAutoscaler is the configuration for a horizontal pod
  70. // autoscaler, which automatically manages the replica count of any resource
  71. // implementing the scale subresource based on the metrics specified.
  72. message HorizontalPodAutoscaler {
  73. // metadata is the standard object metadata.
  74. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
  75. // +optional
  76. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  77. // spec is the specification for the behaviour of the autoscaler.
  78. // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status.
  79. // +optional
  80. optional HorizontalPodAutoscalerSpec spec = 2;
  81. // status is the current information about the autoscaler.
  82. // +optional
  83. optional HorizontalPodAutoscalerStatus status = 3;
  84. }
  85. // HorizontalPodAutoscalerCondition describes the state of
  86. // a HorizontalPodAutoscaler at a certain point.
  87. message HorizontalPodAutoscalerCondition {
  88. // type describes the current condition
  89. optional string type = 1;
  90. // status is the status of the condition (True, False, Unknown)
  91. optional string status = 2;
  92. // lastTransitionTime is the last time the condition transitioned from
  93. // one status to another
  94. // +optional
  95. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
  96. // reason is the reason for the condition's last transition.
  97. // +optional
  98. optional string reason = 4;
  99. // message is a human-readable explanation containing details about
  100. // the transition
  101. // +optional
  102. optional string message = 5;
  103. }
  104. // HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.
  105. message HorizontalPodAutoscalerList {
  106. // metadata is the standard list metadata.
  107. // +optional
  108. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  109. // items is the list of horizontal pod autoscaler objects.
  110. repeated HorizontalPodAutoscaler items = 2;
  111. }
  112. // HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
  113. message HorizontalPodAutoscalerSpec {
  114. // scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics
  115. // should be collected, as well as to actually change the replica count.
  116. optional CrossVersionObjectReference scaleTargetRef = 1;
  117. // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.
  118. // It defaults to 1 pod.
  119. // +optional
  120. optional int32 minReplicas = 2;
  121. // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
  122. // It cannot be less that minReplicas.
  123. optional int32 maxReplicas = 3;
  124. // metrics contains the specifications for which to use to calculate the
  125. // desired replica count (the maximum replica count across all metrics will
  126. // be used). The desired replica count is calculated multiplying the
  127. // ratio between the target value and the current value by the current
  128. // number of pods. Ergo, metrics used must decrease as the pod count is
  129. // increased, and vice-versa. See the individual metric source types for
  130. // more information about how each type of metric must respond.
  131. // +optional
  132. repeated MetricSpec metrics = 4;
  133. }
  134. // HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.
  135. message HorizontalPodAutoscalerStatus {
  136. // observedGeneration is the most recent generation observed by this autoscaler.
  137. // +optional
  138. optional int64 observedGeneration = 1;
  139. // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods,
  140. // used by the autoscaler to control how often the number of pods is changed.
  141. // +optional
  142. optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
  143. // currentReplicas is current number of replicas of pods managed by this autoscaler,
  144. // as last seen by the autoscaler.
  145. optional int32 currentReplicas = 3;
  146. // desiredReplicas is the desired number of replicas of pods managed by this autoscaler,
  147. // as last calculated by the autoscaler.
  148. optional int32 desiredReplicas = 4;
  149. // currentMetrics is the last read state of the metrics used by this autoscaler.
  150. // +optional
  151. repeated MetricStatus currentMetrics = 5;
  152. // conditions is the set of conditions required for this autoscaler to scale its target,
  153. // and indicates whether or not those conditions are met.
  154. repeated HorizontalPodAutoscalerCondition conditions = 6;
  155. }
  156. // MetricSpec specifies how to scale based on a single metric
  157. // (only `type` and one other matching field should be set at once).
  158. message MetricSpec {
  159. // type is the type of metric source. It should be one of "Object",
  160. // "Pods" or "Resource", each mapping to a matching field in the object.
  161. optional string type = 1;
  162. // object refers to a metric describing a single kubernetes object
  163. // (for example, hits-per-second on an Ingress object).
  164. // +optional
  165. optional ObjectMetricSource object = 2;
  166. // pods refers to a metric describing each pod in the current scale target
  167. // (for example, transactions-processed-per-second). The values will be
  168. // averaged together before being compared to the target value.
  169. // +optional
  170. optional PodsMetricSource pods = 3;
  171. // resource refers to a resource metric (such as those specified in
  172. // requests and limits) known to Kubernetes describing each pod in the
  173. // current scale target (e.g. CPU or memory). Such metrics are built in to
  174. // Kubernetes, and have special scaling options on top of those available
  175. // to normal per-pod metrics using the "pods" source.
  176. // +optional
  177. optional ResourceMetricSource resource = 4;
  178. // external refers to a global metric that is not associated
  179. // with any Kubernetes object. It allows autoscaling based on information
  180. // coming from components running outside of cluster
  181. // (for example length of queue in cloud messaging service, or
  182. // QPS from loadbalancer running outside of cluster).
  183. // +optional
  184. optional ExternalMetricSource external = 5;
  185. }
  186. // MetricStatus describes the last-read state of a single metric.
  187. message MetricStatus {
  188. // type is the type of metric source. It will be one of "Object",
  189. // "Pods" or "Resource", each corresponds to a matching field in the object.
  190. optional string type = 1;
  191. // object refers to a metric describing a single kubernetes object
  192. // (for example, hits-per-second on an Ingress object).
  193. // +optional
  194. optional ObjectMetricStatus object = 2;
  195. // pods refers to a metric describing each pod in the current scale target
  196. // (for example, transactions-processed-per-second). The values will be
  197. // averaged together before being compared to the target value.
  198. // +optional
  199. optional PodsMetricStatus pods = 3;
  200. // resource refers to a resource metric (such as those specified in
  201. // requests and limits) known to Kubernetes describing each pod in the
  202. // current scale target (e.g. CPU or memory). Such metrics are built in to
  203. // Kubernetes, and have special scaling options on top of those available
  204. // to normal per-pod metrics using the "pods" source.
  205. // +optional
  206. optional ResourceMetricStatus resource = 4;
  207. // external refers to a global metric that is not associated
  208. // with any Kubernetes object. It allows autoscaling based on information
  209. // coming from components running outside of cluster
  210. // (for example length of queue in cloud messaging service, or
  211. // QPS from loadbalancer running outside of cluster).
  212. // +optional
  213. optional ExternalMetricStatus external = 5;
  214. }
  215. // ObjectMetricSource indicates how to scale on a metric describing a
  216. // kubernetes object (for example, hits-per-second on an Ingress object).
  217. message ObjectMetricSource {
  218. // target is the described Kubernetes object.
  219. optional CrossVersionObjectReference target = 1;
  220. // metricName is the name of the metric in question.
  221. optional string metricName = 2;
  222. // targetValue is the target value of the metric (as a quantity).
  223. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
  224. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  225. // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
  226. // When unset, just the metricName will be used to gather metrics.
  227. // +optional
  228. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  229. // averageValue is the target value of the average of the
  230. // metric across all relevant pods (as a quantity)
  231. // +optional
  232. optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
  233. }
  234. // ObjectMetricStatus indicates the current value of a metric describing a
  235. // kubernetes object (for example, hits-per-second on an Ingress object).
  236. message ObjectMetricStatus {
  237. // target is the described Kubernetes object.
  238. optional CrossVersionObjectReference target = 1;
  239. // metricName is the name of the metric in question.
  240. optional string metricName = 2;
  241. // currentValue is the current value of the metric (as a quantity).
  242. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
  243. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  244. // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
  245. // When unset, just the metricName will be used to gather metrics.
  246. // +optional
  247. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
  248. // averageValue is the current value of the average of the
  249. // metric across all relevant pods (as a quantity)
  250. // +optional
  251. optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
  252. }
  253. // PodsMetricSource indicates how to scale on a metric describing each pod in
  254. // the current scale target (for example, transactions-processed-per-second).
  255. // The values will be averaged together before being compared to the target
  256. // value.
  257. message PodsMetricSource {
  258. // metricName is the name of the metric in question
  259. optional string metricName = 1;
  260. // targetAverageValue is the target value of the average of the
  261. // metric across all relevant pods (as a quantity)
  262. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
  263. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  264. // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
  265. // When unset, just the metricName will be used to gather metrics.
  266. // +optional
  267. optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
  268. }
  269. // PodsMetricStatus indicates the current value of a metric describing each pod in
  270. // the current scale target (for example, transactions-processed-per-second).
  271. message PodsMetricStatus {
  272. // metricName is the name of the metric in question
  273. optional string metricName = 1;
  274. // currentAverageValue is the current value of the average of the
  275. // metric across all relevant pods (as a quantity)
  276. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
  277. // selector is the string-encoded form of a standard kubernetes label selector for the given metric
  278. // When set in the PodsMetricSource, 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 = 3;
  282. }
  283. // ResourceMetricSource indicates how to scale on a resource metric known to
  284. // Kubernetes, as specified in requests and limits, describing each pod in the
  285. // current scale target (e.g. CPU or memory). The values will be averaged
  286. // together before being compared to the target. Such metrics are built in to
  287. // Kubernetes, and have special scaling options on top of those available to
  288. // normal per-pod metrics using the "pods" source. Only one "target" type
  289. // should be set.
  290. message ResourceMetricSource {
  291. // name is the name of the resource in question.
  292. optional string name = 1;
  293. // targetAverageUtilization is the target value of the average of the
  294. // resource metric across all relevant pods, represented as a percentage of
  295. // the requested value of the resource for the pods.
  296. // +optional
  297. optional int32 targetAverageUtilization = 2;
  298. // targetAverageValue is the target value of the average of the
  299. // resource metric across all relevant pods, as a raw value (instead of as
  300. // a percentage of the request), similar to the "pods" metric source type.
  301. // +optional
  302. optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
  303. }
  304. // ResourceMetricStatus indicates the current value of a resource metric known to
  305. // Kubernetes, as specified in requests and limits, describing each pod in the
  306. // current scale target (e.g. CPU or memory). Such metrics are built in to
  307. // Kubernetes, and have special scaling options on top of those available to
  308. // normal per-pod metrics using the "pods" source.
  309. message ResourceMetricStatus {
  310. // name is the name of the resource in question.
  311. optional string name = 1;
  312. // currentAverageUtilization is the current value of the average of the
  313. // resource metric across all relevant pods, represented as a percentage of
  314. // the requested value of the resource for the pods. It will only be
  315. // present if `targetAverageValue` was set in the corresponding metric
  316. // specification.
  317. // +optional
  318. optional int32 currentAverageUtilization = 2;
  319. // currentAverageValue is the current value of the average of the
  320. // resource metric across all relevant pods, as a raw value (instead of as
  321. // a percentage of the request), similar to the "pods" metric source type.
  322. // It will always be set, regardless of the corresponding metric specification.
  323. optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
  324. }