Nomad
ui Block
Placement | ui |
The ui
block configures the Nomad agent's web UI.
ui {
enabled = true
content_security_policy {
connect_src = ["*"]
default_src = ["'none'"]
form_action = ["'none'"]
frame_ancestors = ["'none'"]
img_src = ["'self'","data:"]
script_src = ["'self'"]
style_src = ["'self'","'unsafe-inline'"]
}
consul {
ui_url = "https://consul.example.com:8501/ui"
}
vault {
ui_url = "https://vault.example.com:8200/ui"
}
label {
text = "Staging Cluster"
background_color = "yellow"
text_color = "#000000"
}
}
A default ui
block is automatically merged with all Nomad agent
configurations. Note that the UI can be served from any Nomad agent,
and the configuration is individual to each agent.
ui
Parameters
enabled
(bool: true)
- Specifies whether the web UI is enabled. If disabled, the/ui/
path will return an empty web page.consul
(Consul: nil)
- Configures integrations between the Nomad web UI and the Consul web UI.vault
(Vault: nil)
- Configures integrations between the Nomad web UI and the Vault web UI.label
(Label: nil)
- Configures a user-defined label to display in the Nomad Web UI header.cli_url_links
(bool: true)
- Controls whether CLI commands display hints about equivalent UI pages. For example, when runningnomad server members
, the CLI will show a message indicating where to find server information in the web UI. Set tofalse
to disable these hints.
content_security_policy
Parameters
The content_security_policy
block configures the HTTP
Content-Security-Policy
header sent with the web UI response.
connect_src
(array<string>: ["*"])
- Specifies the valid sources forconnect-src
in the Content Security Policy header.default_src
(array<string>: ["'none'"])
- Specifies the valid sources fordefault-src
in the Content Security Policy header.form_action
(array<string>: ["'none'"])
- Specifies the valid sources forform-action
in the Content Security Policy header.frame_ancestors
(array<string>: ["'none'"])
- Specifies the valid sources forframe-ancestors
in the Content Security Policy header.img_src
(array<string>: ["'self'", "data:"])
- Specifies the valid sources forimg-src
in the Content Security Policy header.script_src
(array<string>: ["'self'"])
- Specifies the valid sources forscript-src
in the Content Security Policy header.style_src
(array<string>: ["'self'","'unsafe-inline'"])
- Specifies the valid sources forstyle-src
in the Content Security Policy header.
consul
Parameters
ui_url
(string: "")
- Specifies the full base URL to a Consul web UI (for example:https://consul.example.com:8501/ui
. This URL is used to build links from the Nomad web UI to a Consul web UI. Note that this URL will not typically be the same one used for the agent'sconsul.address
; theconsul.address
is the URL used by the Nomad to communicate with Consul, whereas theui.consul.ui_url
is the URL you'll visit in your browser. If this field is omitted, this integration will be disabled.
vault
Parameters
ui_url
(string: "")
- Specifies the full base URL to a Vault web UI (for example:https://vault.example.com:8200/ui
. This URL is used to build links from the Nomad web UI to a Vault web UI. Note that this URL will not typically be the same one used for the agent'svault.address
; thevault.address
is the URL used by the Nomad to communicate with Vault, whereas theui.vault.ui_url
is the URL you'll visit in your browser. If this field is omitted, this integration will be disabled.
label
Parameters
text
(string: "")
- Specifies the text of the label that will be displayed in the header of the Web UI.background_color
(string: "")
- The background color of the label to be displayed. The Web UI will default to a black background. HEX values may be used.text_color
(string: "")
- The text color of the label to be displayed. The Web UI will default to white text. HEX values may be used.