hashicorp / faas-nomad

OpenFaaS plugin for Nomad
https://www.openfaas.com
MIT License
254 stars 46 forks source link

Feature/vagrant env #44

Closed acornies closed 5 years ago

acornies commented 5 years ago

Portable Vagrantfile, saltstack for comprehensive Hashicorp stack testing with OpenFaaS. Addresses:

nicholasjackson commented 5 years ago

@acornies This looks great, will test this and hopefully merge this morning

nicholasjackson commented 5 years ago

With VMWare Fusion the Nomad config which is provisioned has the following details

{"advertise": {"http": "192.168.50.2"}, "client": {"enabled": true, "meta": {"faas_host": "true", "service_host": "true"}, "network_interface": "enp0s8"}, "consul": {"address": "127.0.0.1:8500", "auto_advertise": true, "client_auto_join": true, "client_service_name": "nomad-client", "server_auto_join": true, "server_service_name": "nomad"}, "data_dir": "/var/lib/nomad", "datacenter": "dc1", "server": {"bootstrap_expect": 1, "enabled": true, "encrypt": "AaABbB+CcCdDdEeeFFfggG=="}, "vault": {"address": "http://127.0.0.1:8200", "enabled": true, "token": "vagrant"}}

However the network "enp0s8" does not exist, fusion only provisions the following:

docker0   Link encap:Ethernet  HWaddr 02:42:d0:ec:1d:cf
          inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:0c:29:3d:2f:75
          inet addr:172.16.49.131  Bcast:172.16.49.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:95184 errors:0 dropped:0 overruns:0 frame:0
          TX packets:13195 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:130404370 (130.4 MB)  TX bytes:1966958 (1.9 MB)

eth1      Link encap:Ethernet  HWaddr 00:0c:29:3d:2f:7f
          inet addr:192.168.50.2  Bcast:192.168.50.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2886 (2.8 KB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1628 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1628 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:119944 (119.9 KB)  TX bytes:119944 (119.9 KB)
nicholasjackson commented 5 years ago

I am also thinking we should move the terraform and vagrant stuff to a sub folder i.e.

/provisioning/vagrant /provisioning/terraform

That way we can clean up the root folder to only contain source code

acornies commented 5 years ago

Make sense - I'll dig up my vmware fusion license do these updates.

acornies commented 5 years ago

will close in favour another branch PR