...

Text file src/k8s.io/api/autoscaling/v1/generated.proto

Documentation: k8s.io/api/autoscaling/v1

     1/*
     2Copyright The Kubernetes Authors.
     3
     4Licensed under the Apache License, Version 2.0 (the "License");
     5you may not use this file except in compliance with the License.
     6You may obtain a copy of the License at
     7
     8    http://www.apache.org/licenses/LICENSE-2.0
     9
    10Unless required by applicable law or agreed to in writing, software
    11distributed under the License is distributed on an "AS IS" BASIS,
    12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13See the License for the specific language governing permissions and
    14limitations under the License.
    15*/
    16
    17
    18// This file was autogenerated by go-to-protobuf. Do not edit it manually!
    19
    20syntax = "proto2";
    21
    22package k8s.io.api.autoscaling.v1;
    23
    24import "k8s.io/api/core/v1/generated.proto";
    25import "k8s.io/apimachinery/pkg/api/resource/generated.proto";
    26import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
    27import "k8s.io/apimachinery/pkg/runtime/generated.proto";
    28import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
    29
    30// Package-wide variables from generator "generated".
    31option go_package = "k8s.io/api/autoscaling/v1";
    32
    33// ContainerResourceMetricSource indicates how to scale on a resource metric known to
    34// Kubernetes, as specified in the requests and limits, describing a single container in
    35// each of the pods of the current scale target(e.g. CPU or memory). The values will be
    36// averaged together before being compared to the target. Such metrics are built into
    37// Kubernetes, and have special scaling options on top of those available to
    38// normal per-pod metrics using the "pods" source. Only one "target" type
    39// should be set.
    40message ContainerResourceMetricSource {
    41  // name is the name of the resource in question.
    42  optional string name = 1;
    43
    44  // targetAverageUtilization is the target value of the average of the
    45  // resource metric across all relevant pods, represented as a percentage of
    46  // the requested value of the resource for the pods.
    47  // +optional
    48  optional int32 targetAverageUtilization = 2;
    49
    50  // targetAverageValue is the target value of the average of the
    51  // resource metric across all relevant pods, as a raw value (instead of as
    52  // a percentage of the request), similar to the "pods" metric source type.
    53  // +optional
    54  optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
    55
    56  // container is the name of the container in the pods of the scaling target.
    57  optional string container = 5;
    58}
    59
    60// ContainerResourceMetricStatus indicates the current value of a resource metric known to
    61// Kubernetes, as specified in requests and limits, describing a single container in each pod in the
    62// current scale target (e.g. CPU or memory).  Such metrics are built in to
    63// Kubernetes, and have special scaling options on top of those available to
    64// normal per-pod metrics using the "pods" source.
    65message ContainerResourceMetricStatus {
    66  // name is the name of the resource in question.
    67  optional string name = 1;
    68
    69  // currentAverageUtilization is the current value of the average of the
    70  // resource metric across all relevant pods, represented as a percentage of
    71  // the requested value of the resource for the pods.  It will only be
    72  // present if `targetAverageValue` was set in the corresponding metric
    73  // specification.
    74  // +optional
    75  optional int32 currentAverageUtilization = 2;
    76
    77  // currentAverageValue is the current value of the average of the
    78  // resource metric across all relevant pods, as a raw value (instead of as
    79  // a percentage of the request), similar to the "pods" metric source type.
    80  // It will always be set, regardless of the corresponding metric specification.
    81  optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
    82
    83  // container is the name of the container in the pods of the scaling taget
    84  optional string container = 4;
    85}
    86
    87// CrossVersionObjectReference contains enough information to let you identify the referred resource.
    88// +structType=atomic
    89message CrossVersionObjectReference {
    90  // kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    91  optional string kind = 1;
    92
    93  // name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
    94  optional string name = 2;
    95
    96  // apiVersion is the API version of the referent
    97  // +optional
    98  optional string apiVersion = 3;
    99}
   100
   101// ExternalMetricSource indicates how to scale on a metric not associated with
   102// any Kubernetes object (for example length of queue in cloud
   103// messaging service, or QPS from loadbalancer running outside of cluster).
   104message ExternalMetricSource {
   105  // metricName is the name of the metric in question.
   106  optional string metricName = 1;
   107
   108  // metricSelector is used to identify a specific time series
   109  // within a given metric.
   110  // +optional
   111  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
   112
   113  // targetValue is the target value of the metric (as a quantity).
   114  // Mutually exclusive with TargetAverageValue.
   115  // +optional
   116  optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
   117
   118  // targetAverageValue is the target per-pod value of global metric (as a quantity).
   119  // Mutually exclusive with TargetValue.
   120  // +optional
   121  optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 4;
   122}
   123
   124// ExternalMetricStatus indicates the current value of a global metric
   125// not associated with any Kubernetes object.
   126message ExternalMetricStatus {
   127  // metricName is the name of a metric used for autoscaling in
   128  // metric system.
   129  optional string metricName = 1;
   130
   131  // metricSelector is used to identify a specific time series
   132  // within a given metric.
   133  // +optional
   134  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector metricSelector = 2;
   135
   136  // currentValue is the current value of the metric (as a quantity)
   137  optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
   138
   139  // currentAverageValue is the current value of metric averaged over autoscaled pods.
   140  // +optional
   141  optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 4;
   142}
   143
   144// configuration of a horizontal pod autoscaler.
   145message HorizontalPodAutoscaler {
   146  // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   147  // +optional
   148  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
   149
   150  // spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
   151  // +optional
   152  optional HorizontalPodAutoscalerSpec spec = 2;
   153
   154  // status is the current information about the autoscaler.
   155  // +optional
   156  optional HorizontalPodAutoscalerStatus status = 3;
   157}
   158
   159// HorizontalPodAutoscalerCondition describes the state of
   160// a HorizontalPodAutoscaler at a certain point.
   161message HorizontalPodAutoscalerCondition {
   162  // type describes the current condition
   163  optional string type = 1;
   164
   165  // status is the status of the condition (True, False, Unknown)
   166  optional string status = 2;
   167
   168  // lastTransitionTime is the last time the condition transitioned from
   169  // one status to another
   170  // +optional
   171  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastTransitionTime = 3;
   172
   173  // reason is the reason for the condition's last transition.
   174  // +optional
   175  optional string reason = 4;
   176
   177  // message is a human-readable explanation containing details about
   178  // the transition
   179  // +optional
   180  optional string message = 5;
   181}
   182
   183// list of horizontal pod autoscaler objects.
   184message HorizontalPodAutoscalerList {
   185  // Standard list metadata.
   186  // +optional
   187  optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
   188
   189  // items is the list of horizontal pod autoscaler objects.
   190  repeated HorizontalPodAutoscaler items = 2;
   191}
   192
   193// specification of a horizontal pod autoscaler.
   194message HorizontalPodAutoscalerSpec {
   195  // reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption
   196  // and will set the desired number of pods by using its Scale subresource.
   197  optional CrossVersionObjectReference scaleTargetRef = 1;
   198
   199  // minReplicas is the lower limit for the number of replicas to which the autoscaler
   200  // can scale down.  It defaults to 1 pod.  minReplicas is allowed to be 0 if the
   201  // alpha feature gate HPAScaleToZero is enabled and at least one Object or External
   202  // metric is configured.  Scaling is active as long as at least one metric value is
   203  // available.
   204  // +optional
   205  optional int32 minReplicas = 2;
   206
   207  // maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
   208  optional int32 maxReplicas = 3;
   209
   210  // targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
   211  // if not specified the default autoscaling policy will be used.
   212  // +optional
   213  optional int32 targetCPUUtilizationPercentage = 4;
   214}
   215
   216// current status of a horizontal pod autoscaler
   217message HorizontalPodAutoscalerStatus {
   218  // observedGeneration is the most recent generation observed by this autoscaler.
   219  // +optional
   220  optional int64 observedGeneration = 1;
   221
   222  // lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods;
   223  // used by the autoscaler to control how often the number of pods is changed.
   224  // +optional
   225  optional k8s.io.apimachinery.pkg.apis.meta.v1.Time lastScaleTime = 2;
   226
   227  // currentReplicas is the current number of replicas of pods managed by this autoscaler.
   228  optional int32 currentReplicas = 3;
   229
   230  // desiredReplicas is the  desired number of replicas of pods managed by this autoscaler.
   231  optional int32 desiredReplicas = 4;
   232
   233  // currentCPUUtilizationPercentage is the current average CPU utilization over all pods, represented as a percentage of requested CPU,
   234  // e.g. 70 means that an average pod is using now 70% of its requested CPU.
   235  // +optional
   236  optional int32 currentCPUUtilizationPercentage = 5;
   237}
   238
   239// MetricSpec specifies how to scale based on a single metric
   240// (only `type` and one other matching field should be set at once).
   241message MetricSpec {
   242  // type is the type of metric source.  It should be one of "ContainerResource",
   243  // "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object.
   244  // Note: "ContainerResource" type is available on when the feature-gate
   245  // HPAContainerMetrics is enabled
   246  optional string type = 1;
   247
   248  // object refers to a metric describing a single kubernetes object
   249  // (for example, hits-per-second on an Ingress object).
   250  // +optional
   251  optional ObjectMetricSource object = 2;
   252
   253  // pods refers to a metric describing each pod in the current scale target
   254  // (for example, transactions-processed-per-second).  The values will be
   255  // averaged together before being compared to the target value.
   256  // +optional
   257  optional PodsMetricSource pods = 3;
   258
   259  // resource refers to a resource metric (such as those specified in
   260  // requests and limits) known to Kubernetes describing each pod in the
   261  // current scale target (e.g. CPU or memory). Such metrics are built in to
   262  // Kubernetes, and have special scaling options on top of those available
   263  // to normal per-pod metrics using the "pods" source.
   264  // +optional
   265  optional ResourceMetricSource resource = 4;
   266
   267  // containerResource refers to a resource metric (such as those specified in
   268  // requests and limits) known to Kubernetes describing a single container in each pod of the
   269  // current scale target (e.g. CPU or memory). Such metrics are built in to
   270  // Kubernetes, and have special scaling options on top of those available
   271  // to normal per-pod metrics using the "pods" source.
   272  // This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
   273  // +optional
   274  optional ContainerResourceMetricSource containerResource = 7;
   275
   276  // external refers to a global metric that is not associated
   277  // with any Kubernetes object. It allows autoscaling based on information
   278  // coming from components running outside of cluster
   279  // (for example length of queue in cloud messaging service, or
   280  // QPS from loadbalancer running outside of cluster).
   281  // +optional
   282  optional ExternalMetricSource external = 5;
   283}
   284
   285// MetricStatus describes the last-read state of a single metric.
   286message MetricStatus {
   287  // type is the type of metric source.  It will be one of "ContainerResource",
   288  // "External", "Object", "Pods" or "Resource", each corresponds to a matching field in the object.
   289  // Note: "ContainerResource" type is available on when the feature-gate
   290  // HPAContainerMetrics is enabled
   291  optional string type = 1;
   292
   293  // object refers to a metric describing a single kubernetes object
   294  // (for example, hits-per-second on an Ingress object).
   295  // +optional
   296  optional ObjectMetricStatus object = 2;
   297
   298  // pods refers to a metric describing each pod in the current scale target
   299  // (for example, transactions-processed-per-second).  The values will be
   300  // averaged together before being compared to the target value.
   301  // +optional
   302  optional PodsMetricStatus pods = 3;
   303
   304  // resource refers to a resource metric (such as those specified in
   305  // requests and limits) known to Kubernetes 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
   308  // to normal per-pod metrics using the "pods" source.
   309  // +optional
   310  optional ResourceMetricStatus resource = 4;
   311
   312  // containerResource refers to a resource metric (such as those specified in
   313  // requests and limits) known to Kubernetes describing a single container in each pod in the
   314  // current scale target (e.g. CPU or memory). Such metrics are built in to
   315  // Kubernetes, and have special scaling options on top of those available
   316  // to normal per-pod metrics using the "pods" source.
   317  // +optional
   318  optional ContainerResourceMetricStatus containerResource = 7;
   319
   320  // external refers to a global metric that is not associated
   321  // with any Kubernetes object. It allows autoscaling based on information
   322  // coming from components running outside of cluster
   323  // (for example length of queue in cloud messaging service, or
   324  // QPS from loadbalancer running outside of cluster).
   325  // +optional
   326  optional ExternalMetricStatus external = 5;
   327}
   328
   329// ObjectMetricSource indicates how to scale on a metric describing a
   330// kubernetes object (for example, hits-per-second on an Ingress object).
   331message ObjectMetricSource {
   332  // target is the described Kubernetes object.
   333  optional CrossVersionObjectReference target = 1;
   334
   335  // metricName is the name of the metric in question.
   336  optional string metricName = 2;
   337
   338  // targetValue is the target value of the metric (as a quantity).
   339  optional k8s.io.apimachinery.pkg.api.resource.Quantity targetValue = 3;
   340
   341  // selector is the string-encoded form of a standard kubernetes label selector for the given metric.
   342  // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
   343  // When unset, just the metricName will be used to gather metrics.
   344  // +optional
   345  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
   346
   347  // averageValue is the target value of the average of the
   348  // metric across all relevant pods (as a quantity)
   349  // +optional
   350  optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
   351}
   352
   353// ObjectMetricStatus indicates the current value of a metric describing a
   354// kubernetes object (for example, hits-per-second on an Ingress object).
   355message ObjectMetricStatus {
   356  // target is the described Kubernetes object.
   357  optional CrossVersionObjectReference target = 1;
   358
   359  // metricName is the name of the metric in question.
   360  optional string metricName = 2;
   361
   362  // currentValue is the current value of the metric (as a quantity).
   363  optional k8s.io.apimachinery.pkg.api.resource.Quantity currentValue = 3;
   364
   365  // selector is the string-encoded form of a standard kubernetes label selector for the given metric
   366  // When set in the ObjectMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
   367  // When unset, just the metricName will be used to gather metrics.
   368  // +optional
   369  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 4;
   370
   371  // averageValue is the current value of the average of the
   372  // metric across all relevant pods (as a quantity)
   373  // +optional
   374  optional k8s.io.apimachinery.pkg.api.resource.Quantity averageValue = 5;
   375}
   376
   377// PodsMetricSource indicates how to scale on a metric describing each pod in
   378// the current scale target (for example, transactions-processed-per-second).
   379// The values will be averaged together before being compared to the target
   380// value.
   381message PodsMetricSource {
   382  // metricName is the name of the metric in question
   383  optional string metricName = 1;
   384
   385  // targetAverageValue is the target value of the average of the
   386  // metric across all relevant pods (as a quantity)
   387  optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 2;
   388
   389  // selector is the string-encoded form of a standard kubernetes label selector for the given metric
   390  // When set, it is passed as an additional parameter to the metrics server for more specific metrics scoping
   391  // When unset, just the metricName will be used to gather metrics.
   392  // +optional
   393  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
   394}
   395
   396// PodsMetricStatus indicates the current value of a metric describing each pod in
   397// the current scale target (for example, transactions-processed-per-second).
   398message PodsMetricStatus {
   399  // metricName is the name of the metric in question
   400  optional string metricName = 1;
   401
   402  // currentAverageValue is the current value of the average of the
   403  // metric across all relevant pods (as a quantity)
   404  optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 2;
   405
   406  // selector is the string-encoded form of a standard kubernetes label selector for the given metric
   407  // When set in the PodsMetricSource, it is passed as an additional parameter to the metrics server for more specific metrics scoping.
   408  // When unset, just the metricName will be used to gather metrics.
   409  // +optional
   410  optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 3;
   411}
   412
   413// ResourceMetricSource indicates how to scale on a resource metric known to
   414// Kubernetes, as specified in requests and limits, describing each pod in the
   415// current scale target (e.g. CPU or memory).  The values will be averaged
   416// together before being compared to the target.  Such metrics are built in to
   417// Kubernetes, and have special scaling options on top of those available to
   418// normal per-pod metrics using the "pods" source.  Only one "target" type
   419// should be set.
   420message ResourceMetricSource {
   421  // name is the name of the resource in question.
   422  optional string name = 1;
   423
   424  // targetAverageUtilization is the target value of the average of the
   425  // resource metric across all relevant pods, represented as a percentage of
   426  // the requested value of the resource for the pods.
   427  // +optional
   428  optional int32 targetAverageUtilization = 2;
   429
   430  // targetAverageValue is the target value of the average of the
   431  // resource metric across all relevant pods, as a raw value (instead of as
   432  // a percentage of the request), similar to the "pods" metric source type.
   433  // +optional
   434  optional k8s.io.apimachinery.pkg.api.resource.Quantity targetAverageValue = 3;
   435}
   436
   437// ResourceMetricStatus indicates the current value of a resource metric known to
   438// Kubernetes, as specified in requests and limits, describing each pod in the
   439// current scale target (e.g. CPU or memory).  Such metrics are built in to
   440// Kubernetes, and have special scaling options on top of those available to
   441// normal per-pod metrics using the "pods" source.
   442message ResourceMetricStatus {
   443  // name is the name of the resource in question.
   444  optional string name = 1;
   445
   446  // currentAverageUtilization is the current value of the average of the
   447  // resource metric across all relevant pods, represented as a percentage of
   448  // the requested value of the resource for the pods.  It will only be
   449  // present if `targetAverageValue` was set in the corresponding metric
   450  // specification.
   451  // +optional
   452  optional int32 currentAverageUtilization = 2;
   453
   454  // currentAverageValue is the current value of the average of the
   455  // resource metric across all relevant pods, as a raw value (instead of as
   456  // a percentage of the request), similar to the "pods" metric source type.
   457  // It will always be set, regardless of the corresponding metric specification.
   458  optional k8s.io.apimachinery.pkg.api.resource.Quantity currentAverageValue = 3;
   459}
   460
   461// Scale represents a scaling request for a resource.
   462message Scale {
   463  // Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.
   464  // +optional
   465  optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
   466
   467  // spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
   468  // +optional
   469  optional ScaleSpec spec = 2;
   470
   471  // status is the current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.
   472  // +optional
   473  optional ScaleStatus status = 3;
   474}
   475
   476// ScaleSpec describes the attributes of a scale subresource.
   477message ScaleSpec {
   478  // replicas is the desired number of instances for the scaled object.
   479  // +optional
   480  optional int32 replicas = 1;
   481}
   482
   483// ScaleStatus represents the current status of a scale subresource.
   484message ScaleStatus {
   485  // replicas is the actual number of observed instances of the scaled object.
   486  optional int32 replicas = 1;
   487
   488  // selector is the label query over pods that should match the replicas count. This is same
   489  // as the label selector but in the string format to avoid introspection
   490  // by clients. The string will be in the same format as the query-param syntax.
   491  // More info about label selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
   492  // +optional
   493  optional string selector = 2;
   494}
   495

View as plain text