HashiTalks 2021 Demo
Don't be afraid of CSI
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)
- Postgres with PGAdmin frontend
- 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
client_id="11111111-2222-3333-4444-555555555555" client_secret="11111111-2222-3333-4444-555555555555" subscription_id="11111111-2222-3333-4444-555555555555" tenant_id="11111111-2222-3333-4444-555555555555" external_ssh_allowed_access=["184.108.40.206","220.127.116.11","18.104.22.168/22", "22.214.171.124/21"]
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 = http://126.96.36.199:4646
With this information, configure the environment variables for nomad and consul
export NOMAD_ADDR=http://188.8.131.52:4646 export CONSUL_HTTP_ADDR=http://184.108.40.206:8500
After this you should create some entries in your hosts file to allow seamless access the the site as follows:
220.127.116.11 hashitalks2021.local 18.104.22.168 sonarqube.hashitalks2021.local 22.214.171.124 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