{"id":18299788,"url":"https://github.com/containersolutions/terraform-nomad","last_synced_at":"2025-04-09T09:24:23.318Z","repository":{"id":87118095,"uuid":"43873736","full_name":"ContainerSolutions/terraform-nomad","owner":"ContainerSolutions","description":"Terraform scripts for creating a Nomad cluster on Google Cloud.","archived":false,"fork":false,"pushed_at":"2015-12-30T13:06:28.000Z","size":9,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-15T03:29:08.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ContainerSolutions.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-08T08:31:41.000Z","updated_at":"2023-12-04T23:03:14.000Z","dependencies_parsed_at":"2023-03-16T15:05:52.604Z","dependency_job_id":null,"html_url":"https://github.com/ContainerSolutions/terraform-nomad","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fterraform-nomad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fterraform-nomad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fterraform-nomad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ContainerSolutions%2Fterraform-nomad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ContainerSolutions","download_url":"https://codeload.github.com/ContainerSolutions/terraform-nomad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248009736,"owners_count":21032798,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T15:10:23.030Z","updated_at":"2025-04-09T09:24:23.300Z","avatar_url":"https://github.com/ContainerSolutions.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Container Solutions Terraform Nomad\n\nHow to set up a Nomad cluster on the Google Cloud using Terraform\n\n### Install Terraform\n\n* These scripts require Terraform 0.6.3 or greater\n* Follow the instructions on \u003chttps://www.terraform.io/intro/getting-started/install.html\u003e to set up Terraform on your machine.\n\n### Get your Google Cloud JSON Key\n- Visit https://console.developers.google.com\n- Navigate to APIs \u0026 Auth -\u003e Credentials -\u003e Service Account -\u003e Generate new JSON key\n- The file will be downloaded to your machine\n\n### Get Google Cloud SDK\n- Visit https://cloud.google.com/sdk/\n- Install the SDK, login and authenticate with your Google Account.\n\n### Add your SSH key to the Project Metadata\n- Back in the Developer Console, go to Compute - Compute Engine - Metadata and click the SSH Keys tab. Add your public SSH key there.\n- Use the path to the private key and the username in the next step as `gce_ssh_user` and `gce_ssh_private_key_file`\n\n### Prepare variables.tf\n\nCopy the`variables.tf.example` file to `varables.tf` and adjust to your situation\n\n### Create Terraform plan\n\nCreate the plan and save it to a file. \n\n```\nterraform plan -out my.plan\n```\n\n### Create the cluster\n\nOnce you are satisfied with the plan, apply it.\n\n```\nterraform apply my.plan\n```\n\n### Start nomad on every node\n\nLog in to every node. There is a default server.hcl there, copied from the resources dir, that you can use to start the node.\nStart the agent, specifying the address of eth0 to bind to.\n\n`sudo nomad agent -config server.hcl -bind=10.11.12.4`\n\nExecute this on every node, the agent needs to be running on all of them.\n\n### Join the nodes\n\nFrom one of the nodes, connect to the others.\n\n`nomad server-join -address http://$OTHER_SERVER:4646 $MYADDRESS`\n\nYou should see the node joining in the logs. Repeat this step for all nodes in the cluster.\n\n### Set environment variable\n\nTo be able to reach the agent, export the NOMAD_ADDR variable.\n\n`export NOMAD_ADDR=\"http://nomad1:4646\"`\n\n### Destroy the cluster\nWhen you're done, clean up the cluster with\n```\nterraform destroy\n```\n\n## To do\n\n- Automate starting of nomad daemon\n- Discover other nodes\n- Automating joining of other nodes\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainersolutions%2Fterraform-nomad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontainersolutions%2Fterraform-nomad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontainersolutions%2Fterraform-nomad/lists"}