 
 # get changed to true when we first run reconcile_all
 _reconcile_ready = false
-reconcile = (project_id) ->
+reconcile = (project_id, cb) ->
     if not _reconcile_ready
+        cb?()
         return
     x = projects[project_id]
     if x.run
         if not x.kubernetes? or x.kubernetes.DESIRED != '1'
             log("starting because x = ", x)
-            kubectl_start_project(project_id)
+            kubectl_update_project(project_id, cb)
     else
         if x.kubernetes.DESIRED == '1'
             log("stopping because x = ", x)
-            kubectl_stop_project(project_id)
+            kubectl_stop_project(project_id, cb)
 
 reconcile_all = () ->
     _reconcile_ready = true

        (cb) ->
            fs.write(info.fd, deployment_yaml(project_id, storage_server, disk_size, resources, preemptible))
            fs.close(info.fd, cb)
        (cb) ->
            cmd("kubectl create -f #{info.path}", cb)
    ], (err) ->
        if err
            log "failed to start '#{project_id}': ", err
            # Try again in a few seconds  (TODO...)
            setTimeout((()->reconcile(project_id)), 5000)
        else
            log "started '#{project_id}'"
        if info?
            try
                fs.unlink(info.path)
            catch
                # ignore
        w = projects[project_id].starting

        #log("output of '#{s}' -- ", stdout, stderr)
        cb?(err, stdout + stderr)

write_deployment_yaml_file = (project_id, cb) ->
    info = storage_server = disk_size = resources = preemptible = undefined
    async.series([
        (cb) ->
