github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/tools/autoscaling/cli.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: CLI
     4  description: >
     5    The Nomad Autoscaler can be controlled via a command-line interface. This
     6    page documents all the commands the Nomad Autoscaler accepts.
     7  ---
     8  
     9  # Nomad Autoscaler Command: agent
    10  
    11  The agent command is used to start the Nomad Autoscaler which runs until an
    12  interrupt signal is received. The Nomad Autoscaler agent's configuration
    13  primarily comes from the config files used, but a subset of the options may
    14  also be passed directly as CLI arguments. See the
    15  [Nomad Autoscaler Agent guide][nomad_autoscaler_agent_guide] for more information
    16  on how to use this command and the options it has.
    17  
    18  ## Command-line Options
    19  
    20  A subset of the available Nomad Autoscaler agent configuration can optionally be
    21  passed in via CLI arguments. The `agent` command accepts the following arguments:
    22  
    23  - `-config=<path>`: The path to either a single config file or a directory of
    24    config files to use for configuring the Nomad Autoscaler agent.
    25  
    26  - `-log-level=<level>`: Specify the verbosity level of Nomad Autoscaler's logs.
    27    Valid values include `DEBUG`, `INFO`, and `WARN`, in decreasing order of verbosity.
    28    The default is `INFO`.
    29  
    30  - `-log-json`: Output logs in a JSON format. The default is `false`.
    31  
    32  - `-plugin-dir=<path>`: The plugin directory is used to discover Nomad Autoscaler
    33    plugins. If not specified, the plugin directory defaults to be that of
    34    `<current-dir>/plugins/`.
    35  
    36  - `-http-bind-address=<addr>`: The HTTP address that the health server will bind
    37    to. The default is `127.0.0.1`.
    38  
    39  - `-http-bind-port=<port>`: The port that the health server will bind to. The
    40    default is `8080`.
    41  
    42  - `-enable-debug`: Enable the agent debugging HTTP endpoints. The default is
    43    false.
    44  
    45  - `-nomad-address=<addr>`: The address of the Nomad server in the form of
    46    `protocol://addr:port`. The default is `http://127.0.0.1:4646`.
    47  
    48  - `-nomad-region=<region>`: The region of the Nomad servers to connect with.
    49  
    50  - `-nomad-namespace=<namespace>`: The target namespace for queries and actions
    51    bound to a namespace.
    52  
    53  - `-nomad-token=<token>`: The SecretID of an ACL token to use to authenticate
    54    API requests with.
    55  
    56  - `-nomad-http-auth=<username:password>`: The authentication information to use
    57    when connecting to a Nomad API which is using HTTP authentication.
    58  
    59  - `-nomad-ca-cert=<path>`: Path to a PEM encoded CA cert file to use to verify
    60    the Nomad server SSL certificate.
    61  
    62  - `-nomad-ca-path=<path>`: Path to a directory of PEM encoded CA cert files to
    63    verify the Nomad server SSL certificate. If both `-nomad-ca-cert` and
    64    `-nomad-ca-path` are specified, `-nomad-ca-cert` is used.
    65  
    66  - `-nomad-client-cert=<path>`: Path to a PEM encoded client certificate for TLS
    67    authentication to the Nomad server. Must also specify `-nomad-client-key`.
    68  
    69  - `-nomad-client-key=<path>`: Path to an unencrypted PEM encoded private key
    70    matching the client certificate from `-nomad-client-cert`.
    71  
    72  - `-nomad-tls-server-name=<name>`: The server name to use as the SNI host when
    73    connecting via TLS.
    74  
    75  - `-nomad-skip-verify`: Do not verify TLS certificates. This is strongly discouraged.
    76  
    77  - `-policy-dir=<path>`: The path to a directory used to load scaling policies.
    78  
    79  - `-policy-default-cooldown=<dur>`: The default cooldown that will be applied to
    80    all scaling policies which do not specify a cooldown period. The default is `5m`.
    81  
    82  - `-policy-default-evaluation-interval=<dur>`: The default evaluation interval
    83    that will be applied to all scaling policies which do not specify an evaluation
    84    interval. The default is `10s`.
    85  
    86  - `-policy-eval-ack-timeout=<dur>`: The time limit that an eval must be ACK'd before
    87    being considered NACK'd.
    88  
    89  - `-policy-eval-delivery-limit=<num>`: The maximum number of times a policy
    90    evaluation can be dequeued from the broker.
    91  
    92  - `-policy-eval-workers=<key:value>`: The number of workers to initialize for each
    93    queue, formatted as `<queue1>:<num>,<queue2>:<num>`. Nomad Autoscaler supports
    94    `cluster` and `horizontal` queues. Nomad Autoscaler Enterprise supports additional
    95    `vertical_mem` and `vertical_cpu` queues.
    96  
    97  - `-policy-source-disable-file`: Disable the sourcing of policies from disk.
    98  
    99  - `-policy-source-disable-nomad`: Disable the sourcing of policies from the
   100    Nomad API.
   101  
   102  - `-telemetry-disable-hostname`: Specifies whether gauge values should be prefixed
   103    with the local hostname.
   104  
   105  - `-telemetry-enable-hostname-label`: Enable adding hostname to metric labels.
   106  
   107  - `-telemetry-collection-interval=<dur>`: Specifies the time interval at which
   108    the agent collects telemetry data. The default is 1s.
   109  
   110  - `-telemetry-statsite-address=<addr>`: The address of the statsite aggregation
   111    server.
   112  
   113  - `-telemetry-statsd-address=<addr>`: The address of the statsd aggregation.
   114  
   115  - `-telemetry-dogstatsd-address=<addr>`: The address of the Datadog statsd server.
   116  
   117  - `-telemetry-dogstatsd-tag=<tag_list>`: A list of global tags that will be added
   118    to all telemetry packets sent to DogStatsD.
   119  
   120  - `-telemetry-prometheus-metrics`: Indicates whether the agent should make Prometheus
   121    formatted metrics available. Defaults to `false`.
   122  
   123  - `-telemetry-prometheus-retention-time=<dur>`: The time to retain Prometheus
   124    metrics before they are expired and untracked.
   125  
   126  - `-telemetry-circonus-api-token`: A valid API Token used to create/manage check.
   127    If provided, metric management is enabled.
   128  
   129  - `-telemetry-circonus-api-app`: The app name associated with API token. Defaults
   130    to `nomad_autoscaler`.
   131  
   132  - `-telemetry-circonus-api-url`: The base URL to use for contacting the Circonus
   133    API. Defaults to `https://api.circonus.com/v2`.
   134  
   135  - `-telemetry-circonus-submission-interval`: The interval at which metrics are
   136    submitted to Circonus. Defaults to `10s`.
   137  
   138  - `-telemetry-circonus-submission-url`: The check.config.submission_url field
   139    from a previously created HTTPTrap check.
   140  
   141  - `-telemetry-circonus-check-id`: The check id from a previously created HTTPTRAP
   142    check. The numeric portion of the check.\_cid field.
   143  
   144  - `-telemetry-circonus-check-force-metric-activation`: Force enabling metrics,
   145    as they are encountered, if the metric already exists and is NOT active. If
   146    check management is enabled, the default behavior is to add new metrics as
   147    they are encountered.
   148  
   149  - `-telemetry-circonus-check-instance-id`: Uniquely identify the metrics coming
   150    from this agent. Defaults to `hostname:app`.
   151  
   152  - `-telemetry-circonus-check-search-tag`: A special tag that helps to narrow
   153    down the search results when neither a submission URL or check ID are provided.
   154    Defaults to `service:app`.
   155  
   156  - `-telemetry-circonus-check-tags`: A comma separated list of tags to apply to
   157    the check. The value of `-telemetry-circonus-check-search-tag` will always be
   158    added to the check.
   159  
   160  - `-telemetry-circonus-check-display-name`: The name used for the Circonus check
   161    that will be displayed in the UI. This defaults to the value of
   162    `-telemetry-circonus-check-instance-id`.
   163  
   164  - `-telemetry-circonus-broker-id`: The Circonus broker to use when creating a
   165    new check.
   166  
   167  - `-telemetry-circonus-broker-select-tag`: A tag which is used to select a broker
   168    ID when an explicit broker ID is not provided.
   169  
   170  # Nomad Autoscaler Command: version
   171  
   172  The `version` command displays build information about the running binary,
   173  including the release version and the exact revision.
   174  
   175  ## Usage
   176  
   177  ```plaintext
   178  nomad-autoscaler version
   179  ```
   180  
   181  ## Output
   182  
   183  This command prints both the version number as well as the exact commit SHA used
   184  during the build. The SHA may also have the string `+CHANGES` appended to the
   185  end, indicating that local, uncommitted changes were detected at build time.
   186  
   187  ## Examples
   188  
   189  ```shell-session
   190  $ nomad-autoscaler version
   191  Nomad Autoscaler v0.0.3-dev (da91fa9)
   192  ```
   193  
   194  [nomad_autoscaler_agent_guide]: /tools/autoscaling/agent