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".
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?
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.
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.
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
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
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
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