Skip to content

Nomad Cluster with Consul as a DNS and Service discovery

Notifications You must be signed in to change notification settings

open-i-gmbh/nomad-cluster

Repository files navigation

README

Description

  • This Repository is developed to build a nomad cluster with consul and docker driver.
  • The VMs are built using vagrant and provisioned using Ansible.
  • The Solution creates 1 Master and 2 client.
  • For a totaly high available Cluster just uncomment the other 2 Master nodes in Vagrantfile and in inventory

requirement

How to use the Repo:

  • clone the repo
git clone https://github.com/open-i-gmbh/nomad-cluster.git
  • Provision the evviroment
vagrant up  #Build the vms

vagrant ssh [master1|node1|node2]  #to connect via ssh to any vm

ansible-playbook -i ./inventory playbook.yml   #to Provision the enviroment

## connect to the master node and check the nomad status as following:

nomad server members
nomad status
nomad node status
  • deploy a test Job
cd /vagrant/
nomad run webapp.nomad  ### To submit the Job
nomad status demo-webapp  ### Check the Job status

nomad run nginx.nomad   ### Deploy nginx to use as loadbalancer 'reverse proxy'
nomad status nginx
nomad alloc fs 1eb nginx/local/load-balancer.conf  ### Check the registerd backend servers

curl nginx.service.consul:8080

Connect to Nomad webui and consul webui and check the deployment status

Ansible provisioning mit vagrant

  • The Ansible can also provisioned with vagrant.
  • To do that just uncomment the last part in the Vagrantfile and no need to run ansible seperatly.

About

Nomad Cluster with Consul as a DNS and Service discovery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published