vmptk / nomad-hashitalks2021

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HashiTalks 2021 Demo

Don't be afraid of CSI

Demo design

This demo supports the presentation Don't be afraid of CSI by creating, in Azure, a small infrastructure with the following services:

  • 1 Gateway server ( Nomad server/client + Consul server )
  • 3 Docker servers ( Nomad client )
  • 3 Azure Managed Disks ( used to host CSI volumes )

After CSI is deployed we can deploy several applications:

  • Traefik (Reverse proxy)
  • Sonarqube
  • Postgres with PGAdmin frontend


Infrastructure layout


  • Terraform >= 0.13.6
  • Consul >= 1.7.4
  • Azure subscription


Fill out the creds file with your azure subscription details. Here is an example of the file

external_ssh_allowed_access=["","","", ""]

Verify the csi_disks file to check the managed disk that will be created.

Navigate to folder demo_azure and execute the following commands:

terraform init
terraform apply -var-file ../csi_disks -var-file ../creds

Review tbe presented plan and enter yes to start the deployment.

After Terraform finished applying the plan, review the output information as you will need it to the next phase.

Configure access the the infrastructure

In the output you will get something like this:

nomad_address =

With this information, configure the environment variables for nomad and consul

export NOMAD_ADDR=

After this you should create some entries in your hosts file to allow seamless access the the site as follows:   hashitalks2021.local   sonarqube.hashitalks2021.local   postgres.hashitalks2021.local

Deploy CSI workloads and plugins

Navigate to folder nomad_csi and execute the following command

terraform apply -var-file ../csi_disks -var-file ../creds -var="infra=demo_azure"

This will deploy the CSI plugin that will take care of mounting the disks requested by the various workloads.

After this you can start deploying the applications, starting with traefik.

nomad job run -hcl1 nomad_jobs/traefik.nomad
nomad job run -hcl1 nomad_jobs/pgadmin.nomad
nomad job run -hcl1 nomad_jobs/sonarqube.nomad

You can navigate to the various application with this links



Language:HCL 99.0%Language:Shell 1.0%