github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/commands/namespace/apply.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: namespace apply'
     4  description: |
     5    The namespace apply command is used create or update a namespace.
     6  ---
     7  
     8  # Command: namespace apply
     9  
    10  The `namespace apply` command is used create or update a namespace.
    11  
    12  ~> Namespaces are open source in Nomad 1.0. Namespaces were Enterprise-only
    13  when introduced in Nomad 0.7.
    14  
    15  ## Usage
    16  
    17  ```plaintext
    18  nomad namespace apply [options] <input>
    19  ```
    20  
    21  Apply is used to create or update a namespace. The HCL specification file
    22  will be read from stdin by specifying "-", otherwise a path to the file is
    23  expected.
    24  
    25  Instead of a file, you may instead pass the namespace name to create
    26  or update as the only argument.
    27  
    28  If ACLs are enabled, this command requires a management ACL token.
    29  
    30  ## General Options
    31  
    32  @include 'general_options_no_namespace.mdx'
    33  
    34  ## Apply Options
    35  
    36  - `-quota` : An optional quota to apply to the namespace.
    37  
    38  - `-description` : An optional human readable description for the namespace.
    39  
    40  - `-json` : Parse the input as a JSON namespace specification.
    41  
    42  ## Examples
    43  
    44  Create a namespace with a quota:
    45  
    46  ```shell-session
    47  $ nomad namespace apply -description "Prod API servers" -quota prod api-prod
    48  Successfully applied namespace "api-prod"!
    49  ```
    50  
    51  Remove a quota from a namespace:
    52  
    53  ```shell-session
    54  $ nomad namespace apply -quota= api-prod
    55  ```
    56  
    57  Create a namespace from a file:
    58  ```shell-session
    59  $ cat namespace.hcl
    60  name        = "dev"
    61  description = "Namespace for developers"
    62  
    63  capabilities {
    64    enabled_task_drivers  = ["docker", "exec"]
    65    disabled_task_drivers = ["raw_exec"]
    66  }
    67  
    68  meta {
    69    owner        = "John Doe"
    70    contact_mail = "john@mycompany.com"
    71  }
    72  $ nomad namespace apply namespace.hcl
    73  ```