Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with k8s.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/ #12765

Closed
Skull0ne opened this issue Feb 21, 2019 · 13 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. language/en Issues or PRs related to English language lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@Skull0ne
Copy link

Skull0ne commented Feb 21, 2019

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

@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 22, 2019
@sftim
Copy link
Contributor

sftim commented Jun 4, 2019

/kind bug
/language en
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. language/en Issues or PRs related to English language and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 4, 2019
@sftim
Copy link
Contributor

sftim commented Jun 4, 2019

Thanks for reporting this @Skull0ne

@reshadde
Copy link

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;

@reshadde
Copy link

reshadde commented Jun 14, 2019

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.

@reshadde
Copy link

reshadde commented Jul 1, 2019

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.

@sftim
Copy link
Contributor

sftim commented Sep 10, 2019

/priority backlog

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Sep 10, 2019
@cueo
Copy link

cueo commented Oct 18, 2019

@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.

@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 16, 2020
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Feb 15, 2020
@naseemkullah
Copy link

Thank you @Skull0ne and @reshadde ...

As per @reshadde's comment, AverageValue does not seem to work correctly. on k8s 1.14 fwiw

@fejta-bot
Copy link

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

@k8s-ci-robot
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. language/en Issues or PRs related to English language lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

7 participants