From ba4b9d8600fef6181f9f688ab92cec2d4a976189 Mon Sep 17 00:00:00 2001 From: stakater-nordmart-bot Date: Sun, 17 Mar 2024 20:49:31 +0500 Subject: [PATCH] Updates to GrafanaDashboard [skip ci] Changes apiversion to v1beta1 "Update grafanadashboard (#302)" This reverts commit 1762f006b31e721647e5b42d0bd437e06c049f0a, reversing changes made to 9d55ce127a2a8b1556ab9c4d84e3c162cbdd88b3. Revert "[skip-ci] Update artifacts" This reverts commit 826a784118d3852658791fc874f207a5e5ba15a1. update grafana dashboard #major [skip-ci] Update artifacts Revert "Update grafana dashboard #major (#305)" This reverts commit a3bec388de7da1cb1c375c4aca0f88afa067bd1d, reversing changes made to 31225c17b6147c5438114b21a86ed8d7132c5845. Revert "[skip-ci] Update artifacts" This reverts commit e824950c903b384e2d07d7dd77b64697552fd3bd. granfana updates [skip-ci] Update artifacts --- CHANGELOG.md | 2 +- README.md | 16 ++++++++-------- application/Chart.yaml | 2 +- application/templates/grafanadashboard.yaml | 11 +++++------ application/values-test.yaml | 5 +---- application/values.yaml | 12 ++++++++++++ 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d2994ba..6c3810c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented here. ### v3.0.0 -- Feature: Updates the GrafanaDashboard api version to v1beta1 and adds new fields. +- Feature: Updates the GrafanaDashboard api version to v1beta1. ### v2.3.2 - Feature: fix clusterIP null field introduced by [PR-275](https://github.com/stakater/application/pull/275) [PR-295](https://github.com/stakater/application/pull/295) diff --git a/README.md b/README.md index 3c7113a1..613df09a 100644 --- a/README.md +++ b/README.md @@ -427,14 +427,14 @@ Stakater [IngressMonitorController](https://github.com/stakater/IngressMonitorCo ### Grafana Dashboard Paramaters -| Name | Description | Value | -|------------------------------------------------| -------------------------------------------------------------------------------------------- |---------| -| grafanaDashboard.enabled | Enables Grafana Dashboard | `false` | -| grafanaDashboard.additionalLabels | Kubernetes labels object | `{}` | -| grafanaDashboard.annotations | Annotations for Grafana Dashboard | `{}` | -| grafanaDashboard.contents.key | Used as name of Grafana Dashboard object | `""` | -| grafanaDashboard.contents.key.json | json string used as content of Grafana Dashboard object | `""` | -| grafanaDashboard.contents.key.url | Url used to fetch dashboard content. According to GrafanaDashboard behavior, if both url and json are specified then the GrafanaDashboard content will be updated with fetched content from url | `""` | +| Name | Description | Value | +| ------------------------ | -------------------------------------------------------------------------------------------- | --------------- | +| grafanaDashboard.enabled | Enables Grafana Dashboard | `false` | +| grafanaDashboard.additionalLabels | Kubernetes labels object | `{}` | +| grafanaDashboard.annotations | Annotations for Grafana Dashboard | `{}` | +| grafanaDashboard.contents.key | Used as name of Grafana Dashboard object | `""` | +| grafanaDashboard.contents.key.json | json string used as content of Grafana Dashboard object | `""` | +| grafanaDashboard.contents.key.url| Url used to fetch dashboard content. According to GrafanaDashboard behavior, if both url and json are specified then the GrafanaDashboard content will be updated with fetched content from url | `""` | | grafanaDashboard.contents.key.instanceSelector | selects Grafana instances for import | `{}` | | grafanaDashboard.contents.key.folder | folder assignment for dashboard | `""` | | grafanaDashboard.contents.key.configMapRef | dashboard from configmap | `[]` | diff --git a/application/Chart.yaml b/application/Chart.yaml index 0f47a87c..c11d2c69 100644 --- a/application/Chart.yaml +++ b/application/Chart.yaml @@ -6,7 +6,7 @@ type: application # Helm chart Version -version: 2.3.4 +version: 3.0.0 keywords: diff --git a/application/templates/grafanadashboard.yaml b/application/templates/grafanadashboard.yaml index d183abf2..538a4d33 100644 --- a/application/templates/grafanadashboard.yaml +++ b/application/templates/grafanadashboard.yaml @@ -7,14 +7,14 @@ metadata: name: {{ $name }} namespace: {{ template "application.namespace" $ }} labels: - # this label is used as dashboard selector by grafana operator + # this label is used as dashboard selector by grafana operator grafanaDashboard: grafana-operator {{- include "application.labels" $ | nindent 4 }} {{- if $.Values.grafanaDashboard.additionalLabels }} {{ toYaml $.Values.grafanaDashboard.additionalLabels | indent 4 }} {{- end }} {{- if $.Values.grafanaDashboard.annotations }} - annotations: + annotations: {{ toYaml $.Values.grafanaDashboard.annotations | indent 4 }} {{- end }} spec: @@ -39,10 +39,9 @@ spec: configMapRef: {{ toYaml $content.configMapRef | indent 4 }} {{- end }} -{{- if $content.datasources }} + {{- if $content.datasources }} datasources: {{ toYaml $content.datasources | indent 4 }} {{- end }} - {{- end }} - {{- end }} - +{{- end }} +{{- end }} diff --git a/application/values-test.yaml b/application/values-test.yaml index c4a6d5fa..88111350 100644 --- a/application/values-test.yaml +++ b/application/values-test.yaml @@ -777,12 +777,9 @@ grafanaDashboard: additionalLabels: test-label: chart annotations: - test-annotation: chart + test-annoation: chart contents: dashboard-test-name-1: - instanceSelector: - matchLabels: - app: test-1 json: |- { "annotations": { diff --git a/application/values.yaml b/application/values.yaml index 8993952b..ee3ab15d 100644 --- a/application/values.yaml +++ b/application/values.yaml @@ -888,3 +888,15 @@ grafanaDashboard: # "data" # } # url: http://hostname/path/to/file.json + # dashboard-test-name-2: + # allowCrossNamespaceImport: true + # configMapRef: + # key: json + # name: storage-observability-definition + # datasources: + # - datasourceName: Test + # inputName: DS_PROMETHEUS + # folder: Storage Observability + # instanceSelector: + # matchLabels: + # app: test-2 \ No newline at end of file