Setup OpenFaaS Nomad with Puppet
Services
Setup
We’re going to be using Puppet to bootstrap Docker, Consul, and Nomad.
Login and gain root access
Install Puppet for your Ubuntu LTS version. Debian also works but for the sake of this tutorial we are going be to using Ubuntu. The Debian repos can be found here
16.04 LTS
wget https://apt.puppetlabs.com/puppet5-release-xenial.deb sudo dpkg -i puppet5-release-xenial.deb sudo apt update sudo apt-get install puppet-agent
14.04 LTS
wget https://apt.puppetlabs.com/puppet5-release-trusty.deb sudo dpkg -i puppet5-release-trusty.deb sudo apt-get update sudo apt-get install puppet-agent
Exit the current terminal and start a new one to get
puppet
in your PATHClone this repo to your server
cd puppet-openfaas-nomad
sudo su - && puppet apply --modulepath=modules setup.pp
Open [server_ip]:4646 in a browser to view the Nomad web UI
Open [server_ip]:8500 in a browser to view the Consul web UI
You are now ready to schedule jobs in Nomad
OpenFaaS
With OpenFaaS you can package anything as a serverless function - from Node.js to Golang to CSharp, even binaries like ffmpeg or ImageMagick.