Skip to content

Commit

Permalink
charts/victoria-metrics-k8s-stack: add info about adding external das…
Browse files Browse the repository at this point in the history
…hboards (#1604)

* charts/victoria-metrics-k8s-stack: add info about adding external dashboards

* charts/victoria-metrics-k8s-stack: add changelog entry about changed dashboards config
  • Loading branch information
zekker6 authored Oct 18, 2024
1 parent 5a4a557 commit 62efd38
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/victoria-metrics-k8s-stack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next release

- TODO
- Add an explicit fail in case both Grafana dashboard via sidecar and `grafana.dashboards` are enabled. Previously, this configuration would be accepted and sidecar configuration would silently override `.grafana.dashboards` configuration. See [these docs](https://docs.victoriametrics.com/helm/victoriametrics-k8s-stack/#adding-external-dashboards) for information about adding external dashboards.

## 0.27.5

Expand Down
31 changes: 31 additions & 0 deletions charts/victoria-metrics-k8s-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,37 @@ This chart by default install multiple dashboards and recording rules from [kube
you can disable dashboards with `defaultDashboardsEnabled: false` and `experimentalDashboardsEnabled: false`
and rules can be configured under `defaultRules`

### Adding external dashboards

By default, this chart uses sidecar in order to provision default dashboards. If you want to add you own dashboards there are two ways to do it:

- Add dashboards by creating a ConfigMap. An example ConfigMap:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
grafana_dashboard: "1"
name: grafana-dashboard
data:
dashboard.json: |-
{...}
```

- Use init container provisioning. Note that this option requires disabling sidecar and will remove all default dashboards provided with this chart. An example configuration:
```yaml
grafana:
sidecar:
dashboards:
enabled: true
dashboards:
vmcluster:
gnetId: 11176
revision: 38
datasource: VictoriaMetrics
```
When using this approach, you can find dashboards for VictoriaMetrics components published [here](https://grafana.com/orgs/victoriametrics).

### Prometheus scrape configs
This chart installs multiple scrape configurations for kubernetes monitoring. They are configured under `#ServiceMonitors` section in `values.yaml` file. For example if you want to configure scrape config for `kubelet` you should set it in values.yaml like this:
```yaml
Expand Down
31 changes: 31 additions & 0 deletions charts/victoria-metrics-k8s-stack/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,37 @@ This chart by default install multiple dashboards and recording rules from [kube
you can disable dashboards with `defaultDashboardsEnabled: false` and `experimentalDashboardsEnabled: false`
and rules can be configured under `defaultRules`

### Adding external dashboards

By default, this chart uses sidecar in order to provision default dashboards. If you want to add you own dashboards there are two ways to do it:

- Add dashboards by creating a ConfigMap. An example ConfigMap:
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
labels:
grafana_dashboard: "1"
name: grafana-dashboard
data:
dashboard.json: |-
{...}
```

- Use init container provisioning. Note that this option requires disabling sidecar and will remove all default dashboards provided with this chart. An example configuration:
```yaml
grafana:
sidecar:
dashboards:
enabled: true
dashboards:
vmcluster:
gnetId: 11176
revision: 38
datasource: VictoriaMetrics
```
When using this approach, you can find dashboards for VictoriaMetrics components published [here](https://grafana.com/orgs/victoriametrics).

### Prometheus scrape configs
This chart installs multiple scrape configurations for kubernetes monitoring. They are configured under `#ServiceMonitors` section in `values.yaml` file. For example if you want to configure scrape config for `kubelet` you should set it in values.yaml like this:
```yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ Delete condition from dashboard
*/}}
{{- $_ := unset $dashboardData "condition" -}}

{{- if and $.Values.grafana.sidecar.dashboards.enabled $.Values.grafana.dashboards -}}
{{ fail `It is not possible to use both "grafana.sidecar.dashboards.enabled: true" and "grafana.dashboards" at the same time.
Disable either sidecar or dashboards configuration. See more details at https://docs.victoriametrics.com/helm/victoriametrics-k8s-stack/#adding-external-dashboards` }}
{{- end -}}

{{- /*
Check if dashboard is enabled
*/}}
Expand Down

0 comments on commit 62efd38

Please sign in to comment.