Issue with k8s.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
This is a... Need correction in the doc
Problem: I tried to apply this configuration from the doc :
type: Object
object:
metric:
name: requests-per-second
describedObject:
apiVersion: extensions/v1beta1
kind: Ingress
name: main-route
target:
type: Value
value: 2k
Those parameters are not working :
- metric: {name : requests-per-second}
- describedObject
error: error validating "hello_world.yml": error validating data: [ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object): unknown field "describedObject" in io.k8s.api.autoscaling.v2beta1.ObjectMetricSource, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object): unknown field "metric" in io.k8s.api.autoscaling.v2beta1.ObjectMetricSource, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): unknown field "type" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): unknown field "value" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): missing required field "kind" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): missing required field "name" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object): missing required field "metricName" in io.k8s.api.autoscaling.v2beta1.ObjectMetricSource, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object): missing required field "targetValue" in io.k8s.api.autoscaling.v2beta1.ObjectMetricSource]; if you choose to ignore these errors, turn validation off with --validate=false
[...]
error: error validating "hello_world.yml": error validating data: [ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object): unknown field "describedObject" in io.k8s.api.autoscaling.v2beta1.ObjectMetricSource, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): unknown field "type" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): unknown field "value" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): missing required field "kind" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object.target): missing required field "name" in io.k8s.api.autoscaling.v2beta1.CrossVersionObjectReference, ValidationError(HorizontalPodAutoscaler.spec.metrics[2].object): missing required field "targetValue" in io.k8s.api.autoscaling.v2beta1.ObjectMetricSource]; if you choose to ignore these errors, turn validation off with --validate=false
I'm running kubernetes 1.13.2
Proposed Solution: I had to change my config to this :
- type: Object
object:
target:
apiVersion: extensions/v1beta1
kind: Ingress
name: hello-world
targetValue: 200
metricName: requests-per-second
Page to Update: k8s.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
Thanks
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/kind bug /language en /remove-lifecycle stale
Thanks for reporting this @Skull0ne
How would that work now with averageValue
I get following when i simply replace targetValue with averageValue
error validating data: ValidationError(HorizontalPodAutoscaler.spec.metrics[0].object): missing required field "targetValue" in io.k8s.api.autoscaling.v2beta1.ObjectMetricSource;
To be more precise, i want to achieve the following:
https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/#autoscaling-on-multiple-metrics-and-custom-metrics
With Value, the target is compared directly to the returned metric from the API. With AverageValue, the value returned from the custom metrics API is divided by the number of pods before being compared to the target.
targetValue is mandatory so you have to specify both targetValue and averageValue (which has no effect) https://github.com/kubernetes/api/blob/master/autoscaling/v2beta1/types.go#L135 Definition in code is also not up to date with the doc's.
https://github.com/zalando-incubator/kube-metrics-adapter#prometheus-collector
FYI: Replacing the prometheus-adapter and using hpa type "External" solved the issue for average value scaling.
/priority backlog
@Skull0ne The configuration mentioned in the doc is for api version autoscaling/v2beta2. You are probably trying to apply the configuration in an older version.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten
Thank you @Skull0ne and @reshadde ...
As per @reshadde's comment, AverageValue does not seem to work correctly. on k8s 1.14 fwiw
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopen. Mark the issue as fresh with/remove-lifecycle rotten.Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.