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