-
Notifications
You must be signed in to change notification settings - Fork 689
Description
The use case for this is to be able to bring a new server online with an existing kamal deployed setup.
Given I have one web role, one accessory:
servers:
web:
host: 123.456.78.9
accessories:
db:
host: 123.456.78.9
And I want to add another web server into the mix so servers becomes:
servers:
web:
host: 123.456.78.9
web_new:
host: 111.222.333.444
accessories:
db:
host: 123.456.78.9
To bring the server online you'd need to run kamal setup -r web_new so that it pushes up your env files first but that fails with:
docker stderr: docker: Error response from daemon: Conflict. The container name "/hey-db" is already in use by container "7939d26efb157e547d6a70bf0e713a5ccc9079a016ca8261518dbfd6323da5cc". You have to remove (or rename) that container to be able to reuse that name.
I understand that hey-db has already been provisioned and you can work around this by just running kamal deploy -r web_new after that first failure but I think it probably shouldn't try to setup any accessories since they're not being targeted. In this example the accessory is also on a different host so it's not a host target.
So currently it's:
kamal setup -r web_new
# fails at existing container for accessory
kamal deploy -r web_new
# deploys successfully
Thinking we could adjust so that there's a usable server after the setup command finishes running.