Skip to content

Commit 6cd90ed

Browse files
add ui.metrics.pathAllowlist to values.yaml
this field can be configured to override `ui_config.metrics.path_allowlist` in the server ui configuration when `ui.metrics.enabled` is set to `true`
1 parent 19ab7e0 commit 6cd90ed

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.changelog/4445.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
helm: adds `ui.metrics.pathAllowlist` field which can be configured to override `ui_config.metrics.path_allowlist` in the server ui config when `ui.metrics.enabled` is set to `true`.
3+
```

charts/consul/templates/server-config-configmap.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ data:
163163
{{- if (or (eq "true" (.Values.ui.metrics.enabled | toString) ) (and .Values.global.metrics.enabled (eq "-" (.Values.ui.metrics.enabled | toString)))) }}
164164
"metrics_provider": "{{ .Values.ui.metrics.provider }}",
165165
"metrics_proxy": {
166-
"base_url": "{{ .Values.ui.metrics.baseURL }}"
166+
"base_url": "{{ .Values.ui.metrics.baseURL }}",
167+
"path_allowlist": {{ .Values.ui.metrics.pathAllowlist | toJson }}
167168
},
168169
{{- end }}
169170
{{- if .Values.ui.dashboardURLTemplates.service }}

charts/consul/values.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,7 +1926,7 @@ dns:
19261926

19271927
# Refers to an existing Kubernetes secret that contains an ACL token
19281928
# for your Consul cluster. This token provides permissions for the DNS
1929-
# proxy. This field is required when `global.acls.manageSystemACLs`
1929+
# proxy. This field is required when `global.acls.manageSystemACLs`
19301930
# is set to `false` to enable manual ACL management in a Consul cluster.
19311931
# node_prefix "" {
19321932
# policy = "read"
@@ -2071,6 +2071,15 @@ ui:
20712071
# @type: string
20722072
baseURL: http://prometheus-server
20732073

2074+
# pathAllowlist specifies the paths that may be proxied to when appended to
2075+
# baseURL. This limits exposure of the metrics backend to consul.
2076+
# Refer to [`path_allowlist`](https://developer.hashicorp.com/consul/docs/connect/observability/ui-visualization#path-allowlist)
2077+
# This value is only used if `ui.enabled` is set to true.
2078+
# @type: string
2079+
pathAllowlist:
2080+
- /api/v1/query_range
2081+
- /api/v1/query
2082+
20742083
# Corresponds to [`dashboard_url_templates`](https://developer.hashicorp.com/consul/docs/agent/config/config-files#ui_config_dashboard_url_templates)
20752084
# configuration.
20762085
dashboardURLTemplates:
@@ -2220,7 +2229,7 @@ syncCatalog:
22202229
# Set this to false to skip syncing ClusterIP services.
22212230
syncClusterIPServices: true
22222231

2223-
# If true, LoadBalancer service endpoints instead of ingress addresses will be synced to Consul.
2232+
# If true, LoadBalancer service endpoints instead of ingress addresses will be synced to Consul.
22242233
# If false, LoadBalancer endpoints are not synced to Consul.
22252234
syncLoadBalancerEndpoints: false
22262235

@@ -2475,7 +2484,7 @@ connectInject:
24752484
# This value sets the path to use for scraping gateway metrics via prometheus, defaults to /metrics if not set.
24762485
# @type: string
24772486
path: null
2478-
2487+
24792488
# The resource settings for Pods handling traffic for Gateway API.
24802489
# @recurse: false
24812490
# @type: map

0 commit comments

Comments
 (0)