Skip to content

Commit

Permalink
docs: Document setting dashboard_url on k8s (#10510)
Browse files Browse the repository at this point in the history
It's tricky because the `{{` needs to be escaped with Helm.
  • Loading branch information
lkysow authored Jun 30, 2021
1 parent e91996f commit 68c4c23
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions website/content/docs/connect/observability/ui-visualization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ be supported using a new and experimental JavaScript API. See [Custom Metrics
Providers](#custom-metrics-providers).

## Kubernetes

If running Consul in Kubernetes, the Helm chart can automatically configure Consul's UI to display topology
visualizations. See our [Kubernetes observability docs](/docs/k8s/connect/observability/metrics) for more information.

Expand Down Expand Up @@ -92,6 +93,9 @@ to the relevant information.

An example with Grafana is shown below.

<Tabs>
<Tab heading="HCL">

```hcl
ui_config {
enabled = true
Expand All @@ -107,6 +111,32 @@ ui_config {
without horizontal scrolling in the example above however this needs to be a
normal single-line string value in an HCL configuration file.

</Tab>
<Tab heading="Kubernetes YAML">

On Kubernetes, Consul Server configuration is set in your Helm config via the
[`server.extraConfig`](/docs/k8s/helm#v-server-extraconfig) key as JSON:

```yaml
# The UI is enabled by default so this stanza is not required.
ui:
enabled: true
server:
extraConfig: |
{
"ui_config": {
"dashboard_url_templates": {
"service": "https://grafana.example.com/d/lDlaj-NGz/service-overview?orgId=1&var-service={{ "{{" }}Service.Name}}&var-namespace={{ "{{" }}Service.Namespace}}&var-dc={{ "{{" }}Datacenter}}"
}
}
}
```
-> **Note**: The `{{` characters in the URL must be escaped using `{{ "{{" }}` so that Helm doesn't try to template them.

</Tab>
</Tabs>

![Consul UI Service Dashboard Link](/img/ui-dashboard-url-template.png)

### Metrics Proxy
Expand Down

0 comments on commit 68c4c23

Please sign in to comment.