AutoscalingMetric
autoscaling.gke.io / v1beta1
apiVersion: autoscaling.gke.io/v1beta1
kind: AutoscalingMetric
metadata:
name: example
apiVersion
string
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind
string
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata
object
spec object required
Specification of desired pod and metric selection for target discovery
by Prometheus.
endpoints []object
The endpoints to scrape on the selected pods (min 1, max 10).
This field is deprecated, use metrics.pod instead.
minItems:
1maxItems:
10metrics []object required
List of metrics to scrape (min 1, max 20).
minItems:
1maxItems:
20
exportName
string
ExportName specifies an optional new name for the metric to be used when
exported. If not set, the original metric 'Name' is used. This is useful for
renaming metrics to align with different naming conventions or to avoid
conflicts.
filter object
Filter specifies the criteria to filter the metric.
matchLabels
object required
MatchLabels specifies a set of key-value pairs to filter the metric.
Only the metric series matching all the specified labels will be selected.
name
string required
Name of the metric to scrape.
minLength:
1
params
object
HTTP GET params to use when scraping.
path
string
HTTP path to scrape metrics from. Defaults to "/metrics".
maxLength:
256
port
string | integer required
Name or number of the port to scrape.
scheme
string
Protocol scheme to use to scrape.
enum:
http, httpsmetrics []object
Defines a list of autoscaling metrics.
minItems:
1maxItems:
10pod object
An autoscaling metric computed from a Prometheus metric scraped from a set of pods.
containers []object required
Defines metrics to be scraped from endpoints within the selected pods.
Each item typically corresponds to a metrics endpoint in a container.
maxItems:
100endpoint object required
The Prometheus endpoint to scrape within the container.
params
object
HTTP GET params to use when scraping.
path
string
HTTP path to scrape metrics from. Defaults to "/metrics".
maxLength:
256
port
string | integer required
Name or number of the port to scrape. The Pod spec must explicitly declare
the port for the metric endpoint, otherwise the metric is ignored and not
collected.
scheme
string
Protocol scheme to use to scrape. Defaults to "HTTP".
enum:
HTTP, HTTPSmetrics []object required
The specific metrics to collect from this endpoint.
minItems:
1maxItems:
100gauge object
An autoscaling metric that is obtained from a gauge metric.
filter object
An optional filter.
matchLabels
object required
MatchLabels specifies a set of key-value pairs to filter the metric.
Only the metric series matching all the specified labels will be selected.
loadBalancing object
Configuration for metrics used in load balancing
enabled
boolean
Whether this metric will be used as a custom metric for utilization-based load balancing.
name
string required
The name of the autoscaling metric. Must be unique within an AutoscalingMetric resource.
pattern:
^[a-z]([a-z0-9-_]*[a-z0-9])?$minLength:
1maxLength:
63
prometheusMetricName
string
The name of the Prometheus metric to scrape. If not specified, defaults to the "name" field.
selector object required
Label selector that specifies which pods are selected for this
autoscaling metric configuration. Only matchLabels are supported.
matchExpressions []object
matchExpressions is a list of label selector requirements. The requirements are ANDed.
key
string required
key is the label key that the selector applies to.
operator
string required
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
values
[]string
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
matchLabels
object
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
prometheus object
An autoscaling metric that is obtained from a Prometheus server via a PromQL query.
backend object
Configuration for the Prometheus backend. Defaults to the Google Managed Prometheus in the GCP project where the cluster runs.
projectId
string
The GCP Project ID of the Google Managed Prometheus endpoint to use. Defaults to the cluster project.
metricLabels object
MetricLabels specifies the names of the labels expected to be present in the query result.
These labels are used to match against expected values and to extract pod information (e.g., name, namespace).
clusterName
string
Cluster name. Defaults to "cluster".
location
string
Location of the cluster. Defaults to "location".
namespace
string
Namespace of the pod. Defaults to "namespace".
podName
string
Name of the pod. Defaults to "pod".
projectId
string
GCP project ID. Defaults to "project_id".
name
string required
The name of the autoscaling metric. Must be unique within an AutoscalingMetric resource.
pattern:
^[a-z]([a-z0-9-_]*[a-z0-9])?$minLength:
1maxLength:
63
query
string required
The PromQL query to execute to compute the final autoscaling metric.
type
string
The type of the metric. (External, Pods).
This defines the granularity of the metric.
If set to 'Pods', the metric is expected to be a per-pod metric.
If set to 'External', it's expected to be a global metric.
The type must match the metric type of the HorizontalPodAutoscaler (HPA) that references this AutoscalingMetric.
selector object
Label selector that specifies which pods are selected for this
autoscaling metric configuration. Please note that only matchLabels
is currently supported.
This field is deprecated, use metrics.pod instead.
matchExpressions []object
matchExpressions is a list of label selector requirements. The requirements are ANDed.
key
string required
key is the label key that the selector applies to.
operator
string required
operator represents a key's relationship to a set of values.
Valid operators are In, NotIn, Exists and DoesNotExist.
values
[]string
values is an array of string values. If the operator is In or NotIn,
the values array must be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced during a strategic
merge patch.
matchLabels
object
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
map is equivalent to an element of matchExpressions, whose key field is "key", the
operator is "In", and the values array contains only "value". The requirements are ANDed.
status object
Current information about the object.
metricStatuses []object
The list of statuses for each metric defined in the spec.
errors
[]string
List of errors associated with the metric, e.g. invalid label keys.
gclbName
string
The name of the metric to be specified as a custom utilization metric in a GCPBackendPolicy resource.
hpaName
string
The name of the metric to be specified in a HorizontalPodAutoscaler resource.
name
string required
The name of the metric as defined in the AutoscalingMetricSpec.
No matches. Try .spec.endpoints for an exact path