### Build and Launch Device Plugin Source: https://github.com/hashicorp/nomad/blob/main/plugins/shared/cmd/launcher/README.md Build the plugin launcher and the example fs-device plugin, then launch it. This example shows the initial setup and default configuration. ```bash # Current working directory should be the root folder: github.com/hashicorp/nomad # Build the plugin launcher $ go build github.com/hashicorp/nomad/plugins/shared/cmd/launcher/ # Build the example fs-device plugin $ go build -o fs-device github.com/hashicorp/nomad/plugins/device/cmd/example/cmd # Launch the plugin $ ./launcher device ./fs-device > Availabile commands are: exit(), fingerprint(), stop_fingerprint(), stats(), stop_stats(), reserve(id1, id2, ...) > 2018-08-28T14:54:45.658-0700 [INFO ] nomad-plugin-launcher.fs-device: config set: @module=example-fs-device config="example.Config{Dir:".", ListPeriod:"5s", StatsPeriod:"5s", UnhealthyPerm:"-rwxrwxrwx"}" timestamp=2018-08-28T14:54:45.658-0700 ^C 2018-08-28T14:54:54.727-0700 [ERROR] nomad-plugin-launcher: error interacting with plugin: error=interrupted ``` -------------------------------- ### Start Vagrant Box Source: https://github.com/hashicorp/nomad/blob/main/demo/vagrant/README.md Use this command to start the Vagrant environment for the Nomad demo. Ensure Vagrant is installed and the Vagrantfile is present. ```bash vagrant up ``` -------------------------------- ### Run Setup Script Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/nfs/README.md Execute the setup script to deploy all necessary components for the NFS plugins demo. This script automates the deployment of the demo environment. ```bash ./setup.sh ``` -------------------------------- ### Clone and Start Vagrant Environment Source: https://github.com/hashicorp/nomad/blob/main/contributing/README.md Clone the Nomad repository and bring up the Vagrant development environment to install dependencies within the VM. ```bash $ git clone https://github.com/hashicorp/nomad.git $ cd nomad $ vagrant up ``` -------------------------------- ### Build and Install Nomad Device Plugin Source: https://github.com/hashicorp/nomad/blob/main/plugins/device/cmd/example/README.md Build the Go plugin and place it in the Nomad plugins directory. ```shell nomad_plugin_dir='/opt/nomad/plugins' # for example go build -o $nomad_plugin_dir/nomad-device-example ./cmd ``` -------------------------------- ### Run UI in Development Mode Source: https://github.com/hashicorp/nomad/blob/main/ui/README.md Starts the UI in development mode, serving at http://localhost:4200/ui. ```shell pnpm start ``` -------------------------------- ### Example cloud.conf Configuration Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/cinder-csi-plugin/README.md This is an example configuration file for the Openstack Cinder CSI-Plugin. It includes global settings for authentication and region. ```ini [Global] username = openstack-user password = superSecret123 domain-name = default auth-url = https://service01a-c2.example.com:5001/ tenant-id = 5sd6f4s5df6sd6fs5ds65fd4f65s region = RegionOne ``` -------------------------------- ### Create Example Devices with Specific Permissions Source: https://github.com/hashicorp/nomad/blob/main/plugins/device/cmd/example/README.md Create two files in the plugin's monitored directory, one with unhealthy permissions. ```shell mkdir -p /tmp/nomad-device cd /tmp/nomad-device touch device01 && chmod 0777 device01 touch device02 ``` -------------------------------- ### Install Dependencies Source: https://github.com/hashicorp/nomad/blob/main/ui/README.md Installs project dependencies using pnpm after enabling corepack and preparing pnpm. ```shell corepack enable corepack prepare pnpm@latest --activate pnpm i ``` -------------------------------- ### Start a Nomad Node with a Newer Binary Source: https://github.com/hashicorp/nomad/blob/main/e2e/upgrades/README.md This script is used to start a Nomad node, typically during upgrade testing. It uses the specified Nomad binary and rejoins the existing quorum with the same data directory. ```shell ./run_node.sh /path/to/Nomad0.9 server1 ``` ```shell ./run_node.sh /path/to/Nomad0.9 client1 ``` -------------------------------- ### Example: Direct Struct Return for RPC Response Source: https://github.com/hashicorp/nomad/blob/main/contributing/checklist-jobspec.md This approach is used when the struct returned from an RPC call has the same shape as the corresponding struct in the `api/` package, minimizing developer effort. Example: GET `/v1/evaluation/:id`. ```go directly return the struct from the RPC call, if it has the same shape as the corresponding struct in api/ This is convenient when possible, resulting in the least work for the developer. Examples of this approach include [GET `/v1/evaluation/:id`](https://github.com/hashicorp/nomad/blob/v1.0. 0/command/agent/eval_endpoint.go#L88). ``` -------------------------------- ### Start a Development Vault Server Source: https://github.com/hashicorp/nomad/blob/main/dev/vault/README.md Run this command in one shell to start a local development Vault server. This server is suitable for testing purposes. ```shell vault server -dev ``` -------------------------------- ### Mock Driver Allocation Events Source: https://github.com/hashicorp/nomad/blob/main/contributing/mock-driver.md Example allocation events generated by the mock driver, illustrating task lifecycle stages like starting, terminating, and restarting. ```text Recent Events: Time Type Description 2023-03-20T16:22:39-04:00 Restarting Task restarting in 17.426443129s 2023-03-20T16:22:39-04:00 Terminated Exit Code: 0, Signal: 9, Exit Message: "error on exit" 2023-03-20T16:22:09-04:00 Started Task started by client 2023-03-20T16:22:07-04:00 Task Setup Building Task Directory 2023-03-20T16:22:07-04:00 Received Task received by client ``` -------------------------------- ### Install Azure CLI Source: https://github.com/hashicorp/nomad/blob/main/terraform/azure/README.md Installs the Azure CLI on Debian-based systems. Ensure you have the necessary permissions to modify package sources and install packages. ```bash $ echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \ sudo tee /etc/apt/sources.list.d/azure-cli.list $ sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 417A0893 $ sudo apt-get install apt-transport-https $ sudo apt-get update && sudo apt-get install azure-cli ``` -------------------------------- ### Configure Nomad Client Agent for Device Plugin Source: https://github.com/hashicorp/nomad/blob/main/plugins/device/cmd/example/README.md Example client agent configuration to enable and configure the 'nomad-device-example' plugin. ```hcl client { enabled = true } plugin_dir = "/opt/nomad/plugins" plugin "nomad-device-example" { config { dir = "/tmp/nomad-device" list_period = "1s" unhealthy_perm = "-rwxrwxrwx" } } ``` -------------------------------- ### Download and Install Terraform Source: https://github.com/hashicorp/nomad/blob/main/terraform/gcp/README.md Installs the Terraform binary on Linux. Ensure you have `unzip` installed. This command downloads version 0.13.1. ```bash curl "https://releases.hashicorp.com/terraform/0.13.1/terraform_0.13.1_linux_amd64.zip" -o terraform.zip unzip terraform.zip sudo mv terraform /usr/local/bin terraform --version ``` -------------------------------- ### Download and Install Vault Source: https://github.com/hashicorp/nomad/blob/main/terraform/gcp/README.md Installs the Vault binary on Linux. Ensure you have `unzip` installed. This command downloads version 1.5.3. ```bash curl "https://releases.hashicorp.com/vault/1.5.3/vault_1.5.3_linux_amd64.zip" -o vault.zip unzip vault.zip sudo mv vault /usr/local/bin vault --version ``` -------------------------------- ### Clone Repo and Setup Vagrant Environment Source: https://github.com/hashicorp/nomad/blob/main/terraform/README.md Clone the repository and use Vagrant to set up a local staging environment. This pre-installs necessary tools like Packer, Terraform, Docker, and the Azure CLI. ```bash git clone git@github.com:hashicorp/nomad.git cd nomad/terraform vagrant up && vagrant ssh ``` -------------------------------- ### Bootstrap Development Environment without Vagrant Source: https://github.com/hashicorp/nomad/blob/main/contributing/README.md Clone the Nomad repository and bootstrap the development environment using 'make bootstrap'. Ensure Go 1.26.4+ is installed. ```bash $ git clone https://github.com/hashicorp/nomad.git $ cd nomad $ make bootstrap ``` -------------------------------- ### Download and Install Consul Source: https://github.com/hashicorp/nomad/blob/main/terraform/gcp/README.md Installs the Consul binary on Linux. Ensure you have `unzip` installed. This command downloads version 1.8.3. ```bash curl "https://releases.hashicorp.com/consul/1.8.3/consul_1.8.3_linux_amd64.zip" -o consul.zip unzip consul.zip sudo mv consul /usr/local/bin consul --version ``` -------------------------------- ### Download and Install Packer Source: https://github.com/hashicorp/nomad/blob/main/terraform/gcp/README.md Installs the Packer binary on Linux. Ensure you have `unzip` installed. This command downloads version 1.6.2. ```bash curl "https://releases.hashicorp.com/packer/1.6.2/packer_1.6.2_linux_amd64.zip" -o packer.zip unzip packer.zip sudo mv packer /usr/local/bin packer --version ``` -------------------------------- ### Example: Explicit Conversion for RPC Response Source: https://github.com/hashicorp/nomad/blob/main/contributing/checklist-jobspec.md This method involves converting the struct from the RPC call to the appropriate `api/` struct. It requires the most developer effort but guarantees the HTTP response matches the API due to explicit conversion. Example: GET `/v1/volume/csi/:id`. ```go convert the struct from the RPC call to the appropriate api/ struct. This approach is the most developer effort, but it does have a strong guarantee that the HTTP response matches the API, due to the explicit conversion (assuming proper implementation, which requires tests). Examples of this approach include [GET `/v1/volume/csi/:id`](https://github.com/hashicorp/nomad/blob/v1.0.0/command/agent/csi_endpoint.go#L108) ``` -------------------------------- ### Download and Install Nomad Source: https://github.com/hashicorp/nomad/blob/main/terraform/gcp/README.md Installs the Nomad binary on Linux. Ensure you have `unzip` installed. This command downloads version 0.12.4. ```bash curl "https://releases.hashicorp.com/nomad/0.12.4/nomad_0.12.4_linux_amd64.zip" -o nomad.zip unzip nomad.zip sudo mv nomad /usr/local/bin nomad --version ``` -------------------------------- ### Run Vagrant Up Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/nfs/README.md Start a Linux virtual machine using Vagrant, which is required for running the Nomad agent and other demo components. This command sets up the necessary environment. ```bash vagrant up linux ``` -------------------------------- ### Run UI with API Proxy Source: https://github.com/hashicorp/nomad/blob/main/ui/README.md Starts the UI and proxies API traffic to Nomad, serving at http://localhost:4646/ui. ```shell pnpm start:proxy ``` -------------------------------- ### Configure Gluster Volume Variables Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/kadalu-csi/README.md Set environment variables for Gluster volume name and host, and ensure the external Gluster volume is started and has quota enabled. ```bash $ export volname="sample-pool" gluster_hosts="10.x.x.x" gluster_volname="sample-vol" job_dir="${job_dir:-"$(pwd)"}" # Make sure external gluster volume is started and quota is set $ ssh $gluster_hosts "gluster volume info $gluster_volname | grep Status" Status: Started $ ssh $gluster_hosts "gluster volume quota $gluster_volname enable" volume quota : success ``` -------------------------------- ### Start Non-persistent Nomad Server Source: https://github.com/hashicorp/nomad/blob/main/dev/docker-clients/README.md Starts a Nomad agent in development mode with a configuration that allows the Docker driver to start privileged containers. This server is not persistent. ```bash nomad agent -dev -config docker-privileged.hcl ``` -------------------------------- ### Example Changelog Entry for Go Version Update Source: https://github.com/hashicorp/nomad/blob/main/contributing/golang.md This is an example of how Go version updates are noted in the Nomad changelog. It indicates the specific Go version and the associated GitHub issue. ```text * build: Updated to Go 1.12.13 [GH-6606] ``` -------------------------------- ### Start Nomad Agent in Dev Mode Source: https://github.com/hashicorp/nomad/blob/main/contributing/README.md Run the Nomad agent in development mode using the compiled binary. ```bash $ sudo bin/nomad agent -dev ``` -------------------------------- ### Compile Protobufs Source: https://github.com/hashicorp/nomad/blob/main/contributing/README.md Recompile Protobuf files after making changes. Ensure 'buf' is installed via 'make bootstrap'. ```bash $ make proto ``` -------------------------------- ### Setup Nomad Agent Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/nfs/README.md Run a Nomad agent with a configuration that provides host volumes and allows privileged Docker mode. Ensure the agent configuration includes necessary settings for host volumes and Docker. ```bash sudo nomad agent -config=agent.hcl ``` -------------------------------- ### Start a 3 Server, 2 Client Nomad Cluster Source: https://github.com/hashicorp/nomad/blob/main/e2e/upgrades/README.md Use this script to initiate a local Nomad cluster. It requires the path to the Nomad binary and assumes Consul is available in your PATH. ```shell ./run_cluster.sh /path/to/Nomad0.8.7 ``` -------------------------------- ### Run Nomad Dev Agent with TLS Source: https://github.com/hashicorp/nomad/blob/main/demo/tls/README.md Use this command to start a development Nomad agent with TLS enabled. Ensure the `tls-dev.hcl` configuration file is accessible. ```sh nomad agent -dev -config=tls-dev.hcl ``` -------------------------------- ### Example: Intermediate Struct Conversion for RPC Response Source: https://github.com/hashicorp/nomad/blob/main/contributing/checklist-jobspec.md This approach balances developer effort by converting to an intermediate struct that matches the `api/` struct's shape. This conversion can be done in-situ in the agent HTTP handler if it's not needed elsewhere. Otherwise, extensions can be registered in `nomad/jsonhandles/extensions.go`. ```go convert to an intermediate struct with the same shape as the api/ struct. This approach strikes a balance between the former two approaches. This conversion can be performed in-situ in the agent HTTP handler, as long as the conversion doesn't need to appear in other handlers. Otherwise, it is possible to register an extension on the JSON encoding used by the HTTP agent; these extensions can be put in nomad/jsonhandles/extensions.go. ``` -------------------------------- ### Run Nomad Server Agent with TLS Source: https://github.com/hashicorp/nomad/blob/main/demo/tls/README.md This command starts a Nomad server agent with both custom configuration and TLS enabled. Adjust the paths to your custom configuration and the `tls-server.hcl` file as needed. ```sh nomad agent -config=path/to/custom.hcl -config=tls-server.hcl ``` -------------------------------- ### Run Sample App with Persistent Volume Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/kadalu-csi/README.md Deploys a sample application that utilizes a persistent volume. Ensure the job directory is set correctly. ```bash $ nomad run $job_dir/app.nomad ``` -------------------------------- ### Apply Full Infrastructure with Make Source: https://github.com/hashicorp/nomad/blob/main/e2e/terraform/README.md Alternatively, set the NOMAD_LICENSE_PATH and CONSUL_LICENSE_PATH environment variables and run 'make apply_full' from the terraform directory for a streamlined deployment. ```bash export NOMAD_LICENSE_PATH=./nomad.hclic export CONSUL_LICENSE_PATH=./consul.hclic make apply_full ``` -------------------------------- ### Initialize Terraform Source: https://github.com/hashicorp/nomad/blob/main/terraform/gcp/README.md Initializes the Terraform working directory. This downloads the necessary provider plugins. ```bash terraform init ``` -------------------------------- ### Launch Device Plugin with Custom Configuration Source: https://github.com/hashicorp/nomad/blob/main/plugins/shared/cmd/launcher/README.md Create a configuration file for the fs-device plugin and launch it with the custom configuration. This demonstrates how to modify plugin behavior, such as changing the directory and stats period. ```bash # Lets launch changing the configuration $ cat <<\EOF >fs-device.config > config { > dir = "./plugins" > } > EOF $ ./launcher device ./fs-device ./fs-device.config 2018-08-28T14:59:45.886-0700 [INFO ] nomad-plugin-launcher.fs-device: config set: @module=example-fs-device config="example.Config{Dir:\"./plugins\", ListPeriod:\"5s\", StatsPeriod:\"2s\", UnhealthyPerm:\"-rwxrwxrwx\"}" timestamp=2018-08-28T14:59:45.886-0700 > Availabile commands are: exit(), fingerprint(), stop_fingerprint(), stats(), stop_stats(), reserve(id1, id2, ...) > fingerprint() > > fingerprint: &device.FingerprintResponse{ Devices: { &device.DeviceGroup{ Vendor: "nomad", Type: "file", Name: "mock", Devices: { &device.Device{ ID: "serve.go", Healthy: true, HealthDesc: "", HwLocality: (*device.DeviceLocality)(nil), }, }, Attributes: {}, }, }, Error: nil, } ^C 2018-08-28T15:00:00.329-0700 [ERROR] nomad-plugin-launcher: error interacting with plugin: error=interrupted ``` -------------------------------- ### Build UI (Production) Source: https://github.com/hashicorp/nomad/blob/main/ui/README.md Builds the UI for production deployment. ```shell ember build --environment production ``` -------------------------------- ### Start Persistent Nomad Server Source: https://github.com/hashicorp/nomad/blob/main/dev/docker-clients/README.md Starts a Nomad agent in development mode with a persistent configuration. This server can be shut down and restarted without losing state. ```bash nomad agent -config persistent.hcl ``` -------------------------------- ### Initialize and Apply Terraform with Licenses Source: https://github.com/hashicorp/nomad/blob/main/e2e/terraform/README.md Run Terraform init and apply in the e2e/terraform directory, providing paths to your Consul and Nomad Enterprise license files as variables. ```bash cd e2e/terraform/ terraform init terraform apply -var="consul_license=$(cat full_path_to_consul.hclic)" -var="nomad_license=$(cat full_path_to_nomad.hclic)" ``` -------------------------------- ### Serve Nomad Web UI Locally (Development Mode) Source: https://github.com/hashicorp/nomad/blob/main/ui/DEVELOPMENT_MODE.md Use this command to serve the Nomad Web UI locally in development mode. This command assumes you are in the `/ui` directory of the Nomad repository. ```bash ember serve ``` -------------------------------- ### Example Job for Testing Kill Timeout Source: https://github.com/hashicorp/nomad/blob/main/contributing/mock-driver.md An example Nomad job specification demonstrating the use of the mock driver with various configuration options to test task kill timeouts and behavior. ```hcl job "mock" { group "group" { task "task" { driver = "mock_driver" kill_timeout = "5s" config { exit_code = 0 exit_err_msg = "error on exit" exit_signal = 9 kill_after = "3s" run_for = "30s" signal_error = "got signal" start_block_for = "1s" stdout_repeat = 1 stdout_repeat_duration = "10s" stdout_string = "hello, world!\n" } resources { cpu = 128 memory = 128 } } } } ``` -------------------------------- ### Build UI (Development) Source: https://github.com/hashicorp/nomad/blob/main/ui/README.md Builds the UI for development, outputting artifacts to ui/dist. ```shell ember build ``` -------------------------------- ### Check Packer Version Source: https://github.com/hashicorp/nomad/blob/main/e2e/terraform/packer/README.md Verify the installed version of Packer. ```sh $ packer --version 1.6.4 ``` -------------------------------- ### Create Release Binary Source: https://github.com/hashicorp/nomad/blob/main/contributing/README.md Generate static assets, compile Nomad for multiple platforms, and place binaries in the ./pkg directory. ```bash $ make prerelease $ make release $ ls ./pkg ``` -------------------------------- ### Run Stdlib-Style Tests Source: https://github.com/hashicorp/nomad/blob/main/e2e/README.md Execute tests written in the standard Go testing package style using the -run flag with a regex. ```sh go test -v . -run TestExample/TestExample_Simple ``` -------------------------------- ### Restart Sample App and Verify Data Persistence Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/kadalu-csi/README.md Restarts the sample application and verifies that the previously written data is still accessible and its checksum matches. ```bash $ nomad run $job_dir/app.nomad ``` ```bash $ export app=526d5543 ``` ```bash $ nomad alloc exec $app bash -c 'ls /mnt/pv; find /mnt/pv -type f -exec md5sum {} + | cut -f1 -d" " | sort | md5sum' ``` -------------------------------- ### Nomad Quota Specification - Device Limit Source: https://github.com/hashicorp/nomad/blob/main/plugins/device/cmd/example/README.md Example Nomad quota specification limiting the use of the 'nomad/file/mock' device resource. ```hcl name = "dev" limit { region = "global" region_limit { device "nomad/file/mock" { count = 2 # to allow for deployments/reschedules } } } ``` -------------------------------- ### Nomad Job Specification - Device Resource Declaration Source: https://github.com/hashicorp/nomad/blob/main/plugins/device/cmd/example/README.md Example Nomad job specification declaring the use of the 'nomad/file/mock' device resource. ```hcl job "job" { group "grp" { task "tsk" { driver = "..." config {} resources { device "nomad/file/mock" { count = 1 } } } } } ``` -------------------------------- ### Build Ubuntu Jammy AMI Source: https://github.com/hashicorp/nomad/blob/main/e2e/terraform/packer/README.md Initiate a Packer build for the Ubuntu Jammy AMD64 AMI. ```sh ./build ubuntu-jammy-amd64 ``` -------------------------------- ### Start Consul in Dev Mode Source: https://github.com/hashicorp/nomad/blob/main/contributing/README.md Run Consul in development mode to enable service discovery and health checks. Ensure Consul is downloaded first. ```bash $ consul agent -dev ``` -------------------------------- ### Run Smoke Tests Source: https://github.com/hashicorp/nomad/blob/main/contributing/README.md Verify the development environment by running smoke tests with 'make test'. Some tests may fail due to permission issues and can be run individually with 'go test'. ```bash $ make test ``` -------------------------------- ### Check Nomad Node Status Source: https://github.com/hashicorp/nomad/blob/main/dev/docker-clients/README.md Displays the status of Nomad nodes in the cluster. Use this to verify that clients have successfully started up after running the client job. ```bash nomad node-status ``` -------------------------------- ### Check Portworx CSI Plugin Status Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/portworx-csi-plugin/README.md Monitor the status of the Portworx CSI plugin deployment. This command helps verify if the plugin has started successfully. ```bash nomad job status portworx ``` -------------------------------- ### Serve Nomad Web UI Locally with Vagrant (Development Mode) Source: https://github.com/hashicorp/nomad/blob/main/ui/DEVELOPMENT_MODE.md Use this command to serve the Nomad Web UI locally with Vagrant in development mode, utilizing polling for watch and specifying a port. This command assumes you are in the `/ui` directory of the Nomad repository. ```bash ember serve --watch polling --port 4201 ``` -------------------------------- ### Login to Azure CLI Source: https://github.com/hashicorp/nomad/blob/main/terraform/azure/README.md Logs you into your Azure account. The output provides subscription and tenant IDs necessary for subsequent configuration. ```bash $ az login [ { "cloudName": "AzureCloud", "id": "SUBSCRIPTION_ID", "isDefault": true, "name": "Free Trial", "state": "Enabled", "tenantId": "TENANT_ID", "user": { "name": "rob@hashicorp.com", "type": "user" } } ] ``` -------------------------------- ### Implement HTTP Request Wrapper in command/agent/foo_endpoint.go Source: https://github.com/hashicorp/nomad/blob/main/contributing/checklist-rpc-endpoint.md Create a wrapper for the HTTP request in command/agent/foo_endpoint.go for backwards compatibility. This is necessary when an upgraded client or server might forward a request to an older server without support for the new RPC. ACLs can be checked as an optimization. ```go command/agent/foo_endpoint.go ``` -------------------------------- ### Configure HCP Credentials Source: https://github.com/hashicorp/nomad/blob/main/e2e/terraform/README.md Set these environment variables to authenticate with HCP. Ensure you have the correct client ID and secret. ```bash export HCP_CLIENT_ID= export HCP_CLIENT_SECRET= ``` -------------------------------- ### Run All Go Tests Source: https://github.com/hashicorp/nomad/blob/main/e2e/README.md Execute all Go tests within the project. Ensure the client environment for NOMAD_ADDR is set. ```sh $(terraform output environment) cd .. go test -v ./... ``` -------------------------------- ### Initialize and Provision Nomad Cluster with Terraform Source: https://github.com/hashicorp/nomad/blob/main/terraform/aws/README.md Execute Terraform commands to initialize the project, download providers, plan the infrastructure changes, and apply them to provision the Nomad cluster on AWS. Ensure `terraform.tfvars` is correctly configured. ```bash $ terraform init $ terraform get $ terraform plan $ terraform apply ``` -------------------------------- ### Clean Up Demo Resources Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/nfs/README.md Execute the teardown script to delete all resources created during the NFS plugins demo setup. This script removes deployed jobs and volumes. ```bash ./teardown.sh ``` -------------------------------- ### Run Ceph Demo Container with Nomad Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/ceph-csi-plugin/README.md Deploy a single Ceph container as a Nomad job on a Vagrant VM for demonstration purposes. This setup is ephemeral and not for production. ```bash $ ./run-ceph.sh nomad job run -var-file=nomad.vars ./ceph.nomad ==> Monitoring evaluation "68dde586" Evaluation triggered by job "ceph" ==> Monitoring evaluation "68dde586" Evaluation within deployment: "79e23968" Allocation "77fd50fb" created: node "ca3ee034", group "ceph" Evaluation status changed: "pending" -> "complete" ==> Evaluation "68dde586" finished with status "complete" waiting for Ceph to be ready.............................. ready! ``` -------------------------------- ### SSH Access to Windows Clients Source: https://github.com/hashicorp/nomad/blob/main/e2e/terraform/README.md Connect to Windows client nodes using SSH. This command assumes OpenSSH is installed on the Windows instance and uses the Administrator user. ```sh ssh -i keys/${CLUSTER_UNIQUE_IDENTIFIER}/nomad-e2e-*.pem Administrator@${EC2_IP_ADDR} ``` -------------------------------- ### Run Redis Demo Job with CSI Volume Source: https://github.com/hashicorp/nomad/blob/main/demo/csi/hostpath/README.md Launches a Nomad job that utilizes the previously created CSI volumes. This demonstrates a practical application of the hostpath CSI plugin for stateful applications like Redis. ```bash $ nomad job run ./redis.nomad ``` -------------------------------- ### Proxy UI to Custom Nomad API Location Source: https://github.com/hashicorp/nomad/blob/main/ui/README.md Starts the UI and proxies API traffic to a custom Nomad API address. Ensure USE_MIRAGE is set to false. ```shell USE_MIRAGE=false ember serve --proxy http://newlocation:1111 ``` -------------------------------- ### Terraform Configuration for Nomad Cluster Source: https://github.com/hashicorp/nomad/blob/main/terraform/azure/README.md Example Terraform variables for provisioning a Nomad cluster. Configure 'location', 'image_id', 'vm_size', 'server_count', 'client_count', and 'retry_join' for Consul auto-join. ```hcl location = "East US" image_id = "/subscriptions/SUBSCRIPTION_ID/resourceGroups/PACKER/providers/Microsoft.Compute/images/hashistack" vm_size = "Standard_DS1_v2" server_count = 1 client_count = 4 retry_join = "provider=azure tag_name=ConsulAutoJoin tag_value=auto-join subscription_id=SUBSCRIPTION_ID tenant_id=TENANT_ID client_id=CLIENT_ID secret_access_key=CLIENT_SECRET" ```