Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1452021 - HPA API wrongly uses v2alpha1 rather than v1
HPA API wrongly uses v2alpha1 rather than v1
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
3.6.0
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Solly Ross
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-18 03:45 EDT by Xingxing Xia
Modified: 2017-08-16 15 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-10 01:24:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1716 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.6 RPM Release Advisory 2017-08-10 05:02:50 EDT

  None (edit)
Description Xingxing Xia 2017-05-18 03:45:28 EDT
Description of problem:
HPA API wrongly uses v2alpha1 rather than v1. See https://github.com/openshift/origin/issues/14165. Affected card: https://trello.com/c/kj6KUWRF/ . Drafting this bug for QE to track.

Version-Release number of selected component (if applicable):
openshift v3.6.76
kubernetes v1.6.1+5115d708d7

How reproducible:
Always

Steps to Reproduce:
1. Create DCs
$ $ oc new-app -f https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json

2. Then create HPA via CLI:
$ oc autoscale dc/database --min=2 --max=10

3. Create HPA via web:
On web console dc page for frontend, Actions --> Add Autoscaler, input parameters, then Save

Actual results:
2 and 3:
After HPA created, check their API
$ oc get HPA -o yaml

Their API uses v2alpha1 rather than v1

Expected results:
2 and 3:
Should use API autoscaling/v1

Additional info:
Comment 1 Zhang Cheng 2017-05-18 23:19:11 EDT
apiVersion is v1 in upstream, but is v2alpha1 in OCP3.6 as below.

$ oc create -f rc-hello-hpa.yaml
replicationcontroller "hello-hpa" created
$ oc autoscale rc hello-hpa --min=2 --max=10
replicationcontroller "hello-hpa" autoscaled
$ oc get hpa
NAME        REFERENCE                         TARGETS           MINPODS   MAXPODS   REPLICAS   AGE
hello-hpa   ReplicationController/hello-hpa   <unknown> / 80%   2         10        0          4s
$ oc get hpa -o yaml
apiVersion: v1
items:
- apiVersion: autoscaling/v2alpha1
  kind: HorizontalPodAutoscaler
  metadata:
    creationTimestamp: 2017-05-19T03:12:07Z
    name: hello-hpa
    namespace: test
    resourceVersion: "2267"
    selfLink: /apis/autoscaling/v2alpha1/namespaces/test/horizontalpodautoscalers/hello-hpa
    uid: f0eb6de5-3c40-11e7-a2b9-0e631526fd50
  spec:
    maxReplicas: 10
    metrics:
    - resource:
        name: cpu
        targetAverageUtilization: 80
      type: Resource
    minReplicas: 2
    scaleTargetRef:
      apiVersion: v1
      kind: ReplicationController
      name: hello-hpa
  status:
    currentMetrics: null
    currentReplicas: 0
    desiredReplicas: 0
kind: List
metadata: {}
resourceVersion: ""
selfLink: ""
Comment 2 openshift-github-bot 2017-05-21 03:46:53 EDT
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/59eac282082e8547b97a414586e629a99cadc848
UPSTREAM: 45741: Fix discovery version for autoscaling to be v1

The order of the storage setup blocks in the setup for the autoscaling
API group was accidentally inverted, meaning that if the v2alpha1 API
group was turned on, it would be set to the preferred API group-version
for discovery.

This was unintentional; the latest stable version should (v1) should be
preferred instead.

Fixes bug 1452021 (https://bugzilla.redhat.com/show_bug.cgi?id=1452021)
Comment 4 Xingxing Xia 2017-06-05 05:16:09 EDT
Verified in OCP openshift/oc v3.6.94.
HPA created from CLI or web both show correct api version autoscaling/v1:
$ oc get hpa -o yaml
apiVersion: autoscaling/v1

(BTW, however, another issue - bug 1458663 is reported)
Comment 6 errata-xmlrpc 2017-08-10 01:24:06 EDT
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/RHEA-2017:1716

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