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:
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: ""
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)
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)
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