Files
nomad/website/content/docs/commands/namespace/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

81 lines
1.9 KiB
Plaintext

---
layout: docs
page_title: 'nomad namespace apply command reference'
description: |
The `nomad namespace apply` command creates or updates a Nomad namespace.
---
# `nomad namespace apply` command reference
The `namespace apply` command is used create or update a namespace.
<Tip>
Visit the <a href="https://developer.hashicorp.com/nomad/tutorials/manage-clusters/namespaces">
Nomad Namespaces tutorial
</a> for more information.
</Tip>
## Usage
```plaintext
nomad namespace apply [options] <input>
```
Apply is used to create or update a namespace. The HCL specification file
will be read from stdin by specifying "-", otherwise a path to the file is
expected.
Instead of a file, you may instead pass the namespace name to create
or update as the only argument.
If ACLs are enabled, this command requires a management ACL token. In federated
clusters, the namespace 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
- `-quota` : An optional quota to apply to the namespace.
- `-description` : An optional human readable description for the namespace.
- `-json` : Parse the input as a JSON namespace specification.
## Examples
Create a namespace with a quota:
```shell-session
$ nomad namespace apply -description "Prod API servers" -quota prod api-prod
Successfully applied namespace "api-prod"!
```
Remove a quota from a namespace:
```shell-session
$ nomad namespace apply -quota= api-prod
```
Create a namespace from a file:
```shell-session
$ cat namespace.hcl
name = "dev"
description = "Namespace for developers"
capabilities {
enabled_task_drivers = ["docker", "exec"]
disabled_task_drivers = ["raw_exec"]
enabled_network_modes = ["bridge", "cni/custom"]
disabled_network_modes = ["host"]
}
meta {
owner = "John Doe"
contact_mail = "john@mycompany.com"
}
$ nomad namespace apply namespace.hcl
```