Skip to content

FreaksOnE/nomad-lxd-terraform

 
 

Repository files navigation

Hashicorp Nomad cluster with Terraform, LXD and Ansible

Terraform configuration to create a Nomad cluster in LXD using Terraform and Ansible

After deploying, the following urls will be available:

The cluster contains the following nodes:

  • 3 Consul nodes
  • 3 Nomad server nodes
  • 5 Nomad client nodes (3 "apps" nodes, 2 "infra" node)
  • 1 NFS server node
  • 1 Load Balancer node running HAProxy

Terraform creates the machines and generates an inventory that Ansible uses to provision the cluster.

Consul is used to bootstrap the Nomad cluster, for service discovery and service mesh.

The client infra nodes are the entrypoint of the cluster in which Traefik will be deployed and use Consul service catalog to expose applications.

HAProxy is configured to load balance between the two infra nodes. The container will map port 80 on the host in order to expose the services under *.localhost.

The proxy configuration exposes the services at {{ service name }}.apps.localhost, so when you deploy the service hello.nomad, it will be exposed at hello-world.apps.localhost

NFS and CSI Plugin

For storage with the NFS node, a CSI plugin will be configured using the RocketDuck CSI plugin.

The are also examples of other CSI plugins.

Examples

There are 3 example jobs:

About

Example nomad cluster on LXD using Terraform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 99.7%
  • Smarty 0.3%