Few newbie questions

26 views
Skip to first unread message

Brian Makin

unread,
Apr 11, 2020, 4:24:31 PM4/11/20
to Vagrant
I'm setting a microk8s cluster.  To join those nodes I have to run a command on one node, then run the output of that command on another node.
How would I set this up?

Is there a way to make one VM wait for another to come up before it starts to come up?
ie: bring up the master, then all the client nodes?

Dennis Chang

unread,
Apr 15, 2020, 4:14:12 PM4/15/20
to Vagrant
Probably easier to do it manually, but here's an idea to do it automatically.

Imagine you have a Vagrantfile which defines a number of nodes for your microk8s.
Instead of doing the following,

vagrant up node-01 ; vagrant up node-02 ; vagrant up node-03 # etc. from the host

What if you could do,

SEED=startup-script
OUT=$(vagrant up node-01 -c "./${SEED}")
OUT=$(vagrant up node-02 -c "./${OUT}")

etc. (Run a command inside your VM, and save the output to a variable and then reuse it for subsequent calls).

You would need to inject a startup-script inside your nodes, but then in essence you'd be writing a wrapper script which runs the "vagrant up node-X command".

Alvaro Miranda Aguilera

unread,
Apr 16, 2020, 1:10:30 PM4/16/20
to vagra...@googlegroups.com
hi

vagrant will create the vms top to bottom

if you define

client1,2,3
server

it will do server at the end.


If you need to run commands between vms, the best will be use a known ssh key to be able to just do ssh commands

here is an example I did for a docker swarm cluster


Alvaro.


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/c8166fcb-a0a4-418f-bf6b-54ea6f99c3fd%40googlegroups.com.


--
Alvaro

Reply all
Reply to author
Forward
0 new messages