Bug 1250652 - oc scale doesn't work against dc (when no rc is present)
oc scale doesn't work against dc (when no rc is present)
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.0.0
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Michail Kargakis
Yanping Zhang
: UpcomingRelease
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-05 12:49 EDT by Erik M Jacobs
Modified: 2015-09-22 15:52 EDT (History)
8 users (show)

See Also:
Fixed In Version: openshift-3.0.1.900-0.git.251.56c53fd.el7ose.x86_64
Doc Type: Enhancement
Doc Text:
Feature: Users may now specify the replica count by adjusting the scale of a deployment config. Reason: Users may wish to set the replica count before a replication controller has been created. Result: Users may now set the replica count on a deployment config and that value will be used for replication controllers created in the future.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-22 15:52:47 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)

  None (edit)
Description Erik M Jacobs 2015-08-05 12:49:11 EDT
it appears that "oc scale" can't be used on a dc -- only an rc.

For example:

oc get rc (there are none)

oc get dc
NAME      TRIGGERS                    LATEST VERSION
smoke     ConfigChange, ImageChange   0

oc scale dc/smoke -n user00-smoke --replicas=2
error: Scaling the controller failed with: replicationControllers "smoke-0" not found; Current resource version Unknown

It would be nice if scaling the DC set the number of replicas for the deployments "permanently".
Comment 2 Erik M Jacobs 2015-08-05 13:03:05 EDT
Once there is finally at least one RC, this works:

[root@ip-172-18-1-171 ~]# oc get dc -n user00-smoke
NAME      TRIGGERS                    LATEST VERSION
smoke     ConfigChange, ImageChange   1
[root@ip-172-18-1-171 ~]# oc scale dc/smoke -n user00-smoke --replicas=2
scaled
[root@ip-172-18-1-171 ~]# oc get rc -n user00-smoke
CONTROLLER   CONTAINER(S)   IMAGE(S)                                                                                                        SELECTOR                                    REPLICAS
smoke-1      smoke          172.30.109.25:5000/user00-smoke/smoke@sha256:8a8073f1593718b0876f292be45deebb763c3138a40ff546e89d3d5d7a28dc83   deployment=smoke-1,deploymentconfig=smoke   2
[root@ip-172-18-1-171 ~]# 

Why should it be the case that we don't "allow" scaling of the DC before the first deployment?
Comment 3 Clayton Coleman 2015-08-05 13:33:45 EDT
There is no such "permanent".  There is only "the current scale number" which we have decided is owned by the RC (to allow other components to coexist, like autoscaling).

oc scale dc without any deployments should work which definitely needs to be fixed.
Comment 4 Erik M Jacobs 2015-08-05 13:37:52 EDT
agreed - the current scale number is owned by the rc.

However, the dc owns the future scale number, which is why someone might want to scale the dc before there's an rc -- I've just created an app for an A/B test and I know I want to immediately scale to 20% of the size of the existing app.

That's the reasoning for wanting to scale the dc before there's an actual deployment.
Comment 5 openshift-github-bot 2015-09-09 13:49:24 EDT
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/816cee1ffb2c412d866b5482673ba33651249bdd
Bug 1250652: Scale dc template in case of no deployment
Comment 6 Wei Sun 2015-09-10 01:16:00 EDT
Check this bug against devenv-fedora_2313

[fedora@ip-172-18-4-135 ~]$ oc get dc
NAME        TRIGGERS                    LATEST VERSION
nodejs-ex   ConfigChange, ImageChange   0
[fedora@ip-172-18-4-135 ~]$ oc scale dc/nodejs-ex -n wsuntest --replicas=2
I0910 04:42:00.269628   17905 scale.go:42] No deployment found for dc/nodejs-ex. Scaling the deployment configuration template...
deploymentconfig "nodejs-ex" scaled
[fedora@ip-172-18-4-135 ~]$ oc scale dc/nodejs-ex -n wsuntest --replicas=2
deploymentconfig "nodejs-ex" scaled
[fedora@ip-172-18-4-135 ~]$ oc get dc
NAME        TRIGGERS                    LATEST VERSION
nodejs-ex   ConfigChange, ImageChange   1
[fedora@ip-172-18-4-135 ~]$ oc get rc
CONTROLLER    CONTAINER(S)   IMAGE(S)                                                                                                        SELECTOR                                            REPLICAS   AGE
nodejs-ex-1   nodejs-ex      172.30.147.56:5000/wsuntest/nodejs-ex@sha256:f958e41765abaff0b1d1d364278b70b8dc6f8d53200a6a62adf21c4291a55a7c   deployment=nodejs-ex-1,deploymentconfig=nodejs-ex   2          31m

Will check this bug on ose env after the pr is merged to ose
Comment 8 Wei Sun 2015-09-11 01:03:33 EDT
Verified against the latest ose env

[wsun@dhcp-9-84 v3test]$ openshift version
openshift v3.0.1.900-251-g56c53fd
kubernetes v1.1.0-alpha.0-1605-g44c91b1

[wsun@dhcp-9-84 v3test]$ oc get rc
CONTROLLER   CONTAINER(S)   IMAGE(S)   SELECTOR   REPLICAS   AGE
[wsun@dhcp-9-84 v3test]$ oc get dc
NAME        TRIGGERS                    LATEST VERSION
nodejs-ex   ConfigChange, ImageChange   0
[wsun@dhcp-9-84 v3test]$ oc scale dc/nodejs-ex --replicas=2
I0911 11:34:37.568343    5411 scale.go:42] No deployment found for dc/nodejs-ex. Scaling the deployment configuration template...
deploymentconfig "nodejs-ex" scaled
Comment 10 errata-xmlrpc 2015-09-22 15:52:47 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/RHBA-2015:1835

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