Skip to content

Commit 3fa6f70

Browse files
committed
fix(scheduler): make deploy have 0 replicas by default and then use scaling to go up
1 parent 7e7715b commit 3fa6f70

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

rootfs/scheduler/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,10 @@ def deploy(self, namespace, name, image, command, **kwargs): # noqa
359359
logger.info('RC {} already exists under Namespace {}. Stopping deploy'.format(name, namespace)) # noqa
360360
return
361361
except KubeHTTPException:
362-
new_rc = self._create_rc(namespace, name, image, command, **kwargs).json()
362+
# make replicas 0 so scaling handles the work
363+
replicas = kwargs.pop('replicas')
364+
new_rc = self._create_rc(namespace, name, image, command, replicas=0, **kwargs).json()
365+
kwargs['replicas'] = replicas
363366

364367
# Get the desired number to scale to
365368
if old_rc:

0 commit comments

Comments
 (0)