Files
nomad/website/content/docs/commands/node-pool/apply.mdx
Aimee Ukasick dae496e427 Docs: SEO front matter description for search: commands section (#25175)
* Enhance front matter description for search

* acl section

* alloc section

* config section

* deployment section

* eval section

* job section

* license section

* namespace section

* node section

* node pool section

* operator section

* plugin section

* quota section

* recommendation section

* scaling section

* sentinel section

* server section

* service section

* setup section

* system section

* tls section

* var section

* volume section

* change reference to command reference

* Apply suggestions from code review

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>

---------

Co-authored-by: Jeff Boruszak <104028618+boruszak@users.noreply.github.com>
2025-03-19 12:02:02 -05:00

74 lines
1.6 KiB
Plaintext

---
layout: docs
page_title: 'nomad node pool apply command reference'
description: |
The `nomad node pool apply` command creates or updates a node pool.
---
# `nomad node pool apply` command reference
The `node pool apply` command is used to create or update a node pool.
## Usage
```plaintext
nomad node pool apply [options] <input>
```
Apply is used to create or update a node pool. The specification file is read
from stdin by specifying `-`, otherwise a path to the file is expected.
If ACLs are enabled, this command requires a token with the `write` capability
in a `node_pool` policy that matches the node pool being targeted. In federated
clusters, the node pool will be created in the authoritative region and will be
replicated to all federated regions.
## General options
@include 'general_options_no_namespace.mdx'
## Apply options
- `-json`: Parse the input as a JSON node pool specification.
## Examples
Create a node pool from a file:
```hcl
# prod_pool.nomad.hcl
node_pool "prod" {
description = "Node pool for production workloads."
meta {
env = "prod"
}
# Available only in Nomad Enterprise.
scheduler_config {
scheduler_algorithm = "spread"
}
}
```
```shell-session
$ nomad node pool apply prod_pool.nomad.hcl
Successfully applied node pool "prod"!
```
Create a node pool from stdin:
```shell-session
$ cat prod_pool.nomad.hcl | nomad node pool apply -
Successfully applied node pool "prod"!
```
```shell-session
$ cat <<EOF | nomad node pool apply -
node_pool "dev" {
description = "Node pool for dev workloads."
}
EOF
Successfully applied node pool "dev"!
```