footloose
footloose copied to clipboard
How to update the nodes after changing the config?
It may not be that common to update the config after footloose start
-- you may argue that why not just delete and start again.
But there is a potential aha moment that you may think to add one or more extra node(s) after applying footloose start
with a bunch of work that has been done.
How can I "refresh" the config, say by adding one more node?
Is it a good idea to have such a footloose update
command to do that magic?
Well, just did some experiment and here might be a potential workaround:
- update the
footloose.yaml
file with extra node; - now
footloose show
will see that the "extra" node "hasn't been created"; - then
footloose stop
to stop all nodes; - then
footloose create
to create again wherefootloose
is smart enough to detect whether to create those new ones while marking the existing onesMachine xxx is already created...
, which is cool; - then
footloose start
to start all nodes; - and guess what, the work is still in those old nodes without any loss!
But I believe we can streamline this process maybe.
As easy as this:
stelb@stelb-TUXEDO:/tmp/demo$ footloose config create
stelb@stelb-TUXEDO:/tmp/demo$ footloose create
INFO[0000] Creating SSH key: cluster-key ...
INFO[0000] Docker Image: quay.io/footloose/centos7:0.6.3 present locally
INFO[0000] Creating machine: cluster-node0 ...
stelb@stelb-TUXEDO:/tmp/demo$ perl -i.bka -pe 's/: 1/: 2/' footloose.yaml
stelb@stelb-TUXEDO:/tmp/demo$ footloose create
INFO[0000] Docker Image: quay.io/footloose/centos7:0.6.3 present locally
INFO[0000] Creating machine: cluster-node0 ...
INFO[0000] Machine cluster-node0 is already created...
INFO[0000] Creating machine: cluster-node1 ...
If you change more than just the machine count, e.g. adding volumes this cannot be done like this.