generated.proto 18 KB

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