Here is a simple example for HCL

Build better loan database with shared knowledge and strategies.
Post Reply
suchona.kani.z
Posts: 154
Joined: Sat Dec 21, 2024 6:01 am

Here is a simple example for HCL

Post by suchona.kani.z »

In contrast to the purely declarative approach of Kubernetes, in which YAML files describe the desired target state, Nomad uses the in-house configuration language HCL . Originally intended for use with Terraform , it comes with logic functions and operators that can be used to map even complex scenarios. Therefore, the use of additional tools such as kustomize is not necessary.

Of course, Nomad Pack is a comparable counterpart to Helm, so we can also create versioned artifacts here.


NOTE: Complete documentation can be found on the official project page .

Everything about Jobs
Jobs represent the actual work unit in Nomad and can be sent to iran consumer email list the server in various ways - but more on that later.

Basically, the submission of a job is carried out as follows: After the submission has been completed, the evaluation takes place and the necessary steps are recorded and prepared. Then the allocation starts . An execution plan is created and a task group is created, thus also assigning a job to an active client.

NOTE: You should have heard these steps at least once, because you will come across them as status in your daily use of Nomad.

What does a job look like?
Jobs, or the actual job files, consist of various objects (also called stanzas ) and are easiest to explain using concrete examples.

As a rough framework for the next sections, we use a Quarkus-based backend application that can be used to create and manage todo entries via a simple REST API.

NOTE: The corresponding OpenAPI specification can be found here .

Here is our first job file:
<1> Nomad divides clients into datacenters - thus it is datacenter-aware.

<2> Groups can consist of different tasks and are always executed on the same client.

<3> Here we start a maximum of one instance of this group.

<4> A task is the smallest unit in Nomad - comparable to a pod .

<5> The Java Task Driver starts a Jar in a JVM instance.

<6> Most task drivers can be configured - here we set JVM options.

<7> Resource limits can also be set.

<8> And finally we set the network port - we will need this later.

NOTE: For the next steps you need a running Nomad instance - if you still have problems, take a look at the official instructions.

How do I submit a job?
For most Nomad promotions, there are three ways to do it:

With the browser
The easiest way to perform an action is via the browser and the included web interface, which can be accessed immediately after starting Nomad at the following address


The Run Job button at the top right takes you to a dialog where you can send the job definition directly, either via HCL or JSON .
Post Reply