open-nomad/website/content/docs/configuration/ui.mdx
Phil Renaud d3c351d2d2
Label for the Web UI (#16006)
* Demoable state

* Demo mirage color

* Label as a block with foreground and background colours

* Test mock updates

* Go test updated

* Documentation update for label support
2023-02-02 16:29:04 -05:00

90 lines
2.9 KiB
Plaintext

---
layout: docs
page_title: ui Block - Agent Configuration
description: |-
The "ui" block configures the Nomad agent's web UI.
---
# `ui` Block
<Placement groups={['ui']} />
The `ui` block configures the Nomad agent's [web UI].
```hcl
ui {
enabled = true
consul {
ui_url = "https://consul.example.com:8500/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` <code>([Consul]: nil)</code> - Configures integrations
between the Nomad web UI and the Consul web UI.
- `vault` <code>([Vault]: nil)</code> - Configures integrations
between the Nomad web UI and the Vault web UI.
- `label` <code>([Label]: nil)</code> - Configures a user-defined
label to display in the Nomad Web UI header.
## `consul` Parameters
- `ui_url` `(string: "")` - Specifies the full base URL to a Consul
web UI (for example: `https://consul.example.com:8500/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's [`consul.address`]; the `consul.address` is the URL used
by the Nomad to communicate with Consul, whereas the
`ui.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's [`vault.address`]; the `vault.address` is the URL used
by the Nomad to communicate with Vault, whereas the
`ui.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.
- `text_color` `(string: "")` - The text color of the label to be displayed.
The Web UI will default to white text.
[web UI]: /nomad/tutorials/web-ui
[Consul]: /nomad/docs/configuration/ui#consul-parameters
[Vault]: /nomad/docs/configuration/ui#vault-parameters
[Label]: /nomad/docs/configuration/ui#label-parameters
[`consul.address`]: /nomad/docs/configuration/consul#address
[`vault.address`]: /nomad/docs/configuration/vault#address