Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oc scale not taking effect inmediatelly and not shown in console #9053

Closed
jorgemoralespou opened this issue May 27, 2016 · 4 comments
Closed

Comments

@jorgemoralespou
Copy link

I have done this in command line:

[vagrant@origin ~]$ oc new-app kubernetes/guestbook
--> Found Docker image 4305190 (19 months old) from Docker Hub for "kubernetes/guestbook"

    * An image stream will be created as "guestbook:latest" that will track this image
    * This image will be deployed in deployment config "guestbook"
    * Port 3000/tcp will be load balanced by service "guestbook"
      * Other containers can access this service through the hostname "guestbook"
    * WARNING: Image "kubernetes/guestbook" runs as the 'root' user which may not be permitted by your cluster administrator

--> Creating resources with label app=guestbook ...
    imagestream "guestbook" created
    deploymentconfig "guestbook" created
    service "guestbook" created
--> Success
    Run 'oc status' to view your app.

In the UI I see this:
image

Inmediately I do a scaling:

[vagrant@origin ~]$ oc scale kubernetes/guestbook --replicas=10
the server doesn't have a resource type "kubernetes"
[vagrant@origin ~]$ oc scale dc/guestbook --replicas=10
deploymentconfig "guestbook" scaled
[vagrant@origin ~]$ oc get dc
NAME        REVISION   REPLICAS   TRIGGERED BY
guestbook   1          10         config,image(guestbook:latest)
[vagrant@origin ~]$ oc get pods --no-headers | wc -l
1

I can see that now there¡s 10 pods requested, but still 1 pod.

UI Does not reflect this. THIS IS THE ERROR/ISSUE

In the UI I see this:
image

Then after 2 minutes (or so, state consolidation):
I see the console updated:
image

[vagrant@origin ~]$ oc get pods --no-headers | wc -l
10

If I scale now to 20 from CLI:

[vagrant@origin ~]$ oc scale dc/guestbook --replicas=20
deploymentconfig "guestbook" scaled
[vagrant@origin ~]$ oc get dc
NAME        REVISION   REPLICAS   TRIGGERED BY
guestbook   1          20         config,image(guestbook:latest)
[vagrant@origin ~]$ oc get pods --no-headers | wc -l
20

I see immediate change in console.

image

@jorgemoralespou
Copy link
Author

Moved as issue in origin-web-console. openshift/origin-web-console#45

@0xmichalis
Copy link
Contributor

0xmichalis commented May 27, 2016

This is not a console issue. Are you scaling up before the deployment completes?

@jorgemoralespou
Copy link
Author

Yes, I'm scaling before the deployment completes. But as you can see, the DC reflects the scaled value, but console does not. Maybe not sending events to console, but when I scale after deployment, console instantly sees the new value. I'd guess that the console is not watching for events until deployment has finished.
But you know better.
@spadgett Is working on the issue in the console

@0xmichalis
Copy link
Contributor

Yes, I'm scaling before the deployment completes. But as you can see, the DC reflects the scaled value, but console does not. Maybe not sending events to console, but when I scale after deployment, console instantly sees the new value. I'd guess that the console is not watching for events until deployment has finished.

I guess this is your initial deployment. When you scale the deploymentconfig before the deployment finishes, the deploymentconfig will store the new value, and the dc controller will try to scale up the latest complete replication controller. Since there is none (even if there was one), the deployment process will always scale to the desired replicas with which it started the deployment. So you have something like this:

$ oc new-app ...
# dc.spec.replicas = 1 --> desired replicas = 1 --> deployment process will finish with 1 --> rc.spec.replicas = 1
$ oc scale dc --replicas=10 # before the deployment process exits
# dc.spec.replicas = 10, rc.spec.replicas =1

Deployment finishes and after at most 2 minutes (resync interval of the dc controller), the dc will be reconciled, and the rc will be actually scaled up. #9002 fixes this. Every time a deployment completes (the rc is marked as complete), the dc controller will notice it and reconcile the related dc on the spot, so you should be able to notice your 10 pods as soon as the deployment is complete.

cc: @ironcladlou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants