Bug 1686775 - [DOCS] Example of autoscaling object refers to an incorrect api group for DeploymentConfig object
Summary: [DOCS] Example of autoscaling object refers to an incorrect api group for Dep...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Documentation
Version: 3.11.0
Hardware: Unspecified
OS: All
low
low
Target Milestone: ---
: 3.11.0
Assignee: Bob Gaydos
QA Contact: Weinan Liu
Vikram Goyal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-08 09:58 UTC by Joel Rosental R.
Modified: 2019-11-12 16:21 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-12 16:21:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joel Rosental R. 2019-03-08 09:58:00 UTC
Document URL: 
https://docs.openshift.com/container-platform/3.11/dev_guide/pod_autoscaling.html

Section Number and Name: 
Example 1. Horizontal Pod Autoscaler Object Definition

Describe the issue: 
In the example provided, the spec.scaleTargetRef field refers to a DeploymentConfig object that should have an apiVersion's value of 'apps.openshift.io/v1' instead of 'apps/v1'.

Suggestions for improvement: 
Replace 'apps/v1' by 'apps.openshift.io/v1' in spec.scaleTargetRef.apiVersion field.

Comment 1 Bob Gaydos 2019-04-16 14:23:56 UTC
In Example 1. Horizontal Pod Autoscaler Object Definition, replaced 'apps/v1' with 'apps.openshift.io/v1' in the spec.scaleTargetRef.apiVersion field in BOTH VERSIONS of this example (the primary and alternate methods).

PR: https://github.com/openshift/openshift-docs/pull/14458

Comment 3 Weinan Liu 2019-04-17 08:00:53 UTC
`apiVersion: apps/v1` should be updated to  `apiVersion: apps.openshift.io/v1 `

HPA can't get the DC and calculate the current usage with apiVersion: apps/v1.

$ oc get hpa hpa-resource-metrics-memory
NAME                          REFERENCE                         TARGETS         MINPODS   MAXPODS   REPLICAS   AGE
hpa-resource-metrics-memory   DeploymentConfig/httpd-24-rhel7   <unknown>/80%   1         2         0          15h

$ oc describe hpa hpa-resource-metrics-memory 
Name:                                                     hpa-resource-metrics-memory
Namespace:                                                test
Labels:                                                   <none>
Annotations:                                              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"autoscaling/v2beta1","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"name":"hpa-resource-metrics-memory","namespace":"tes...
CreationTimestamp:                                        Thu, 25 Oct 2018 09:43:06 +0900
Reference:                                                DeploymentConfig/httpd-24-rhel7
Metrics:                                                  ( current / target )
  resource memory on pods  (as a percentage of request):  <unknown> / 50%
Min replicas:                                             1
Max replicas:                                             4
DeploymentConfig pods:                                    0 current / 0 desired
Events:                                                   <none>
[cloud-user@master ~]$ oc describe hpa hpa-resource-metrics-memory 
Name:                                                     hpa-resource-metrics-memory
Namespace:                                                test
Labels:                                                   <none>
Annotations:                                              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"autoscaling/v2beta1","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"name":"hpa-resource-metrics-memory","namespace":"tes...
CreationTimestamp:                                        Thu, 25 Oct 2018 09:43:06 +0900
Reference:                                                DeploymentConfig/httpd-24-rhel7
Metrics:                                                  ( current / target )
  resource memory on pods  (as a percentage of request):  <unknown> / 50%
Min replicas:                                             1
Max replicas:                                             4
DeploymentConfig pods:                                    0 current / 0 desired
Events:                                                   <none>


HPA succeeded retrieving the DC and calculating the current usage after replacing apiVersion: apps/v1 with apps.openshift.io/v1.

$ oc get hpa hpa-resource-metrics-memory
NAME                          REFERENCE                         TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
hpa-resource-metrics-memory   DeploymentConfig/httpd-24-rhel7   1%/50%    1         4         1          6m

$ oc describe hpa hpa-resource-metrics-memory 
Name:                                                     hpa-resource-metrics-memory
Namespace:                                                test
Labels:                                                   <none>
Annotations:                                              kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"autoscaling/v2beta1","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"name":"hpa-resource-metrics-memory","namespace":"tes...
CreationTimestamp:                                        Thu, 25 Oct 2018 09:51:26 +0900
Reference:                                                DeploymentConfig/httpd-24-rhel7
Metrics:                                                  ( current / target )
  resource memory on pods  (as a percentage of request):  1% (10084352) / 50%
Min replicas:                                             1
Max replicas:                                             4
DeploymentConfig pods:                                    1 current / 1 desired
Conditions:
  Type            Status  Reason              Message
  ----            ------  ------              -------
  AbleToScale     True    ReadyForNewScale    the last scale time was sufficiently old as to warrant a new scale
  ScalingActive   True    ValidMetricFound    the HPA was able to successfully calculate a replica count from memory resource utilization (percentage of request)
  ScalingLimited  False   DesiredWithinRange  the desired count is within the acceptable range
Events:           <none>

Comment 4 Bob Gaydos 2019-06-04 00:22:36 UTC
Re: Zhou's comment: I checked with the `apiVersion: apps/v1` and `apiVersion: apps.openshift.io/v1 ` , all could create the HPA succeed, not sure which is effective , need jhou's team to verify.

Jhou, can someone from your team confirm?

Thanks

Bob

Comment 5 Weinan Liu 2019-06-04 02:52:14 UTC
(In reply to Bob from comment #4)
> Re: Zhou's comment: I checked with the `apiVersion: apps/v1` and
> `apiVersion: apps.openshift.io/v1 ` , all could create the HPA succeed, not
> sure which is effective , need jhou's team to verify.
> 
> Jhou, can someone from your team confirm?
> 
> Thanks
> 
> Bob

Hi Bob,
Please refer to comment 3.
Both can create HPA successfully, but only one works, is that okay we use `apiVersion: apps.openshift.io/v1 `?

Comment 6 Bob Gaydos 2019-06-04 14:22:54 UTC
Thanks Weinan,

We just needed to know which to recommend. I will clarify apiVersion: apps.openshift.io/v1 in the 4.1 release.

Bob

Comment 7 Bob Gaydos 2019-06-04 17:07:16 UTC
Thanks Kathryn,

I changed the version to 4.1 and left it in assigned state so I'll followup and ensure the correct content.

Bob

Comment 8 Bob Gaydos 2019-07-12 15:55:01 UTC
I changed the API version to the string that has been tested to work in all instances for this topic, `apiVersion: apps.openshift.io/v1`.

Please verify:
Preview: http://file.bos.redhat.com/bgaydos/071219/dev_guide/pod_autoscaling.html
PR: https://github.com/openshift/openshift-docs/pull/15864/files

Thanks,

Bob

Comment 9 Bob Gaydos 2019-07-12 18:05:05 UTC
Disregard my mention of 4.1 release above.

I meant *3.11*.

Comment 11 Bob Gaydos 2019-11-12 16:21:25 UTC
Verified this change is in 3.11 live docs.


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