Nomad + Steampipe
Nomad is a simple and flexible scheduler and orchestrator for managing containers and non-containerized applications across on-prem and clouds at scale.
Steampipe is an open-source zero-ETL engine to instantly query cloud APIs using SQL.
List your Nomad jobs:
select id, name, status, dispatched, namespace, priority, regionfrom nomad_job;
+------+------+---------+------------+-----------+----------+--------+| id | name | status | dispatched | namespace | priority | region |+------+------+---------+------------+-----------+----------+--------+| docs | docs | pending | false | default | 50 | global |+------+------+---------+------------+-----------+----------+--------+
Documentation
Quick start
Install
Download and install the latest Nomad plugin:
steampipe plugin install nomad
Credentials
Item | Description |
---|---|
Credentials | Nomad requires an address and namespace or address , namespace and Secret ID for all requests. |
Permissions | The permission scope of Secret IDs is set by the Admin at the creation time of the ACL tokens. |
Radius | Each connection represents a single Nomad Installation. |
Resolution | 1. Credentials explicitly set in a steampipe config file (~/.steampipe/config/nomad.spc )2. Credentials specified in environment variables, e.g., NOMAD_ADDR and NOMAD_TOKEN . |
Configuration
Installing the latest nomad plugin will create a config file (~/.steampipe/config/nomad.spc
) with a single connection named nomad
:
Configure your account details in ~/.steampipe/config/nomad.spc
:
connection "nomad" { plugin = "nomad"
# Address is required for requests. Required. # This can also be set via the NOMAD_ADDR environment variable. # address = "http://18.118.164.168:4646"
# The secret ID of ACL token is required for ACL-enabled Nomad servers. Optional. # For more information on the ACL Token, please see https://developer.hashicorp.com/nomad/tutorials/access-control/access-control-tokens. # This can also be set via the NOMAD_TOKEN environment variable. # secret_id = "c178b810-8b18-6f38-016f-725ddec5d58"
# Namespace is required for Nomad Enterprise access. Optional. # API will execute with default namespace if this parameter is not set. # This can also be set via the NOMAD_NAMESPACE environment variable. # "*" indicates all the namespaces available. # namespace = "*"}
secret_id
parameter is only required to query the ACL tables likenomad_acl_auth_method
,nomad_acl_binding_rule
,nomad_acl_policy
,nomad_acl_role
andnomad_acl_token
tables.namespace
parameter is only required to query thenomad_namespace
table.
Alternatively, you can also use the standard Nomad environment variable to obtain credentials only if other arguments (address
, token
, and namespace
) are not specified in the connection:
export NOMAD_ADDR=http://18.118.144.168:4646export NOMAD_TOKEN=c178b810-8b18-6f38-016f-725ddec5d58export NOMAD_NAMESPACE=*
Postgres FDW
This plugin is available as a native Postgres FDW. Unlike Steampipe CLI, which ships with an embedded Postgres server instance, the Postgres FDW can be installed in any supported Postgres database version.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_postgres_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" -- nomad
The installer will prompt you for the plugin name and version, download and install the appropriate files for your OS, system architecture, and Postgres version.
To configure the Postgres FDW, you will create an extension, foreign server, and schema and import the foreign schema.
CREATE EXTENSION IF NOT EXISTS steampipe_postgres_nomad;CREATE SERVER steampipe_nomad FOREIGN DATA WRAPPER steampipe_postgres_nomad OPTIONS (config '<your_config>');CREATE SCHEMA nomad;IMPORT FOREIGN SCHEMA nomad FROM SERVER steampipe_nomad INTO nomad;
SQLite Extension
This plugin is available as a SQLite Extension, making the tables available as SQLite virtual tables.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_sqlite_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" -- nomad
The installer will prompt you for the plugin name, version, and destination directory. It will then determine the OS and system architecture, and it will download and install the appropriate package.
To configure the SQLite extension, load the extension module and then run the steampipe_configure_nomad
function to configure it with plugin-specific options.
$ sqlite3sqlite> .load ./steampipe_sqlite_extension_nomad.sosqlite> select steampipe_configure_nomad('<your_config>');
Export
This plugin is available as a standalone Export 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>' <table_name>