The HPA docs at https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/ provide two examples of the selector
property, one for the pod and the other for the object metric types. One of these examples is a nested object, the other is a string. For example:
- type: External
external:
metric:
name: queue_messages_ready
selector: "queue=worker_tasks"
target:
type: AverageValue
averageValue: 30
and
type: Object
object:
metric:
name: http_requests
selector: {matchLabels: {verb: GET}}
The API docs at https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#metricidentifier-v2beta2-autoscaling provide this description for the selector
field:
selector is the string-encoded form of a standard kubernetes label selector for the given metric
So does this mean you can define the selector
property as a string (for example selector: "matchLabels: {verb: GET}"
) as well as a nested object?