Files
nomad/command/asset/pool.nomad.hcl
James Rasell c80c60965f node pool: Allow specifying node identity ttl in HCL or JSON spec. (#26825)
The node identity TTL defaults to 24hr but can be altered by
setting the node identity TTL parameter. In order to allow setting
and viewing the value, the field is now plumbed through the CLI
and HTTP API.

In order to parse the HCL, a new helper package has been created
which contains generic parsing and decoding functionality for
dealing with HCL that contains time durations. hclsimple can be
used when this functionality is not needed. In order to parse the
JSON, custom marshal and unmarshal functions have been created as
used in many other places.

The node pool init command has been updated to include this new
parameter, although commented out, so reference. The info command
now includes the TTL in its output too.
2025-09-24 14:20:34 +01:00

36 lines
1.3 KiB
HCL

node_pool "example" {
description = "Example node pool"
# meta is optional metadata on the node pool, defined as key-value pairs.
# The scheduler does not use node pool metadata as part of scheduling.
meta {
environment = "prod"
owner = "sre"
}
# node identity TTL is an optional parameter that sets the TTL for all node
# identities issued to nodes in this node pool. The value must be a valid
# duration string (e.g. "30m", "1h", "24h"). If not set, the default value is
# "24h".
# node_identity_ttl = "24h"
# The scheduler configuration options specific to this node pool. This block
# supports a subset of the fields supported in the global scheduler
# configuration as described at:
# https://developer.hashicorp.com/nomad/commands/operator/scheduler/set-config
#
# * scheduler_algorithm is the scheduling algorithm to use for the pool.
# If not defined, the global cluster scheduling algorithm is used.
#
# * memory_oversubscription_enabled specifies whether memory oversubscription
# is enabled. If not defined, the global cluster configuration is used.
#
# Available only in Nomad Enterprise.
# scheduler_config {
# scheduler_algorithm = "spread"
# memory_oversubscription_enabled = true
# }
}