Table: nomad_node - Query Nomad Nodes using SQL
A Nomad Node is a physical or virtual machine that has the Nomad agent running on it. It is responsible for running tasks and reporting on their status. Nodes are registered with a Nomad cluster and are managed by the server agents.
Table Usage Guide
The nomad_node
table provides insights into nodes within HashiCorp Nomad. As a DevOps engineer, explore node-specific details through this table, including status, resources, and associated metadata. Utilize it to uncover information about nodes, such as their availability, resource utilization, and the tasks they are running.
Examples
Basic info
Explore the status and configuration of nodes within your network to understand their performance and identify any potential issues. This can help in maintaining optimal network performance and preemptively addressing any problems.
select name, id, node_class, drain, status, datacenter, cgroup_parentfrom nomad_node;
select name, id, node_class, drain, status, datacenter, cgroup_parentfrom nomad_node;
List nodes with drain enabled
Uncover the details of nodes that have the drain feature enabled. This is particularly useful for identifying nodes that are temporarily not accepting any new allocations, which can aid in resource management and troubleshooting.
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere drain;
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere drain = 1;
List nodes which are not ready
Determine the areas in which nodes are not yet ready for operation. This is beneficial for identifying potential issues in your network and addressing them proactively to avoid disruptions.
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere status <> 'ready';
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere status != 'ready';
List nodes with TLS disabled
Discover the segments that have Transport Layer Security (TLS) disabled in your network. This is essential to identify potential security vulnerabilities and ensure all nodes in your network are secure.
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere not tls_enabled;
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere tls_enabled = 0;
List nodes which are eligible for scheduling
Discover the segments that are eligible for scheduling in a data center, allowing you to better manage resource allocation and workload distribution. This can help you optimize performance and ensure the smooth operation of your systems.
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere scheduling_eligibility = 'eligible';
select name, id, node_class, status, datacenter, cgroup_parentfrom nomad_nodewhere scheduling_eligibility = 'eligible';
Schema for nomad_node
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
attributes | jsonb | A map containing user-defined attributes associated with the node. | |
cgroup_parent | text | A string specifying the parent cgroup for the node. | |
create_index | bigint | = | An unsigned 64-bit integer representing the index at which the node was created. |
csi_controller_plugins | jsonb | A map containing information about the CSI controller plugins installed on the node. | |
csi_node_plugins | jsonb | A map containing information about the CSI node plugins installed on the node. | |
datacenter | text | A string specifying the datacenter in which the node is located. | |
drain | boolean | A boolean value indicating whether the node is currently being drained. | |
drain_strategy | jsonb | Represents the strategy used for draining the node. | |
drivers | jsonb | A map containing information about the drivers installed on the node. | |
events | jsonb | Represents events associated with the node. | |
host_networks | jsonb | A map containing information about the networks attached to the node. | |
host_volumes | jsonb | A map containing information about the volumes attached to the node. | |
http_address | text | A string specifying the HTTP address of the node. | |
id | text | = | A string representing the unique identifier of the node. |
last_drain | jsonb | Represents the metadata for the last drain operation performed on the node. | |
links | jsonb | A map containing links to related resources associated with the node. | |
meta | jsonb | A map containing additional metadata associated with the node. | |
modify_index | bigint | An unsigned 64-bit integer representing the index at which the node was last modified. | |
name | text | = | A string representing the name of the node. |
node_class | text | A string specifying the class of the node. | |
node_resources | jsonb | Represents the resources allocated to the node. | |
reserved | jsonb | Represents the reserved resources on the node. | |
reserved_resources | jsonb | Represents the reserved resources on the node. | |
resources | jsonb | Represents the total resources available on the node. | |
scheduling_eligibility | text | A string specifying the node's scheduling eligibility. | |
status | text | A string representing the current status of the node. | |
status_description | text | A string providing a description of the node's current status. | |
status_updated_at | timestamp with time zone | An integer representing the timestamp at which the node's status was last updated. | |
title | text | The title of the node. | |
tls_enabled | boolean | A boolean value indicating whether TLS is enabled for the node. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- nomad
You can pass the configuration to the command with the --config
argument:
steampipe_export_nomad --config '<your_config>' nomad_node