Bug 1336692 - should not apply a value greater than 100 for CPU utilization targetPercentage by oc edit hpa $name
Summary: should not apply a value greater than 100 for CPU utilization targetPercentag...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Solly Ross
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-17 08:40 UTC by Weihua Meng
Modified: 2017-03-08 18:26 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
The Horizontal Pod Autoscaler scales based on CPU usages as a percentage of the requested CPU for a pod. It is possible that the desired percentage be over 100 (if the user wants to scale only when the CPU usage of a pod is higher than the amount requested for the pod, but below the limit for the pod). Previously, the CLI would prevent the user from setting such values. Now, it allows setting a target CPU percentage of over 100.
Clone Of:
Environment:
Last Closed: 2016-09-27 09:32:42 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1933 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.3 Release Advisory 2016-09-27 13:24:36 UTC

Description Weihua Meng 2016-05-17 08:40:15 UTC
Description of problem:
should not apply a value greater than 100 for CPU utilization targetPercentage by oc edit hpa $name

Version-Release number of selected component (if applicable):
oc v3.2.0.44
kubernetes v1.2.0-36-g4a3f9c5

How reproducible:
Always

Steps to Reproduce:
1. create hpa
2. oc edit hpa $name
spec:
  cpuUtilization:
    targetPercentage: 23456
save and quit
horizontalpodautoscaler "$name" edited
3. oc get hpa $name
NAME                REFERENCE                                       TARGET    CURRENT     MINPODS   MAXPODS   AGE
hello-openshift02   ReplicationController/hello-openshift02/scale   23456%    <waiting>   4         9         44m

Actual results:
TARGET 23456% greater than 100%

Expected results:
should not accept when save and quit

Additional info:
# oc autoscale rc php-apache --max=5 --cpu-percent=150
CPU utilization (%) cannot exceed 100

Comment 1 Solly Ross 2016-05-18 15:31:02 UTC
It's technically valid to specify a target CPU over 100%, since the target is a percentage of requests, and not limits, so it's quite possible for CPU to go over 100% of the requests (see a discussion here for more information: https://github.com/kubernetes/kubernetes/pull/18294).  While you generally don't want a value over 100%, there are valid cases where you might.

It is confusing, however, that `kubectl autoscale` prevents you from setting a value higher than 100, instead of just warning about it.

Comment 2 Solly Ross 2016-05-18 15:41:24 UTC
I've opened an upstream issue to discuss: https://github.com/kubernetes/kubernetes/issues/25815

Comment 3 Andy Goldstein 2016-06-22 10:54:26 UTC
https://github.com/kubernetes/kubernetes/pull/26162 fixes this and it has merged upstream. It's not in origin or ose yet.

Comment 4 Andy Goldstein 2016-07-22 18:34:50 UTC
This is in origin and should be in the 3.3 builds

Comment 5 Weihua Meng 2016-07-25 03:15:32 UTC
Fixed.
openshift v3.3.0.9
kubernetes v1.3.0+57fb9ac
etcd 2.3.0+git

Agree that  targetPercentage can exceed 100%.
Since CLI and oc edit are consistent, It is OK.

Comment 7 errata-xmlrpc 2016-09-27 09:32:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1933


Note You need to log in before you can comment on or make changes to this bug.