Skip to content

Commit

Permalink
updates the api version for grafana dashboard and adds more fields
Browse files Browse the repository at this point in the history
[skip ci]

update changelog

fix the api version

add instance selector

update README

add check for capabilities

Update version with major bump

[skip-ci] Update artifacts

Updates to GrafanaDashboard
[skip ci]
Changes apiversion to v1beta1
"Update grafanadashboard (#302)"

This reverts commit 1762f00, reversing
changes made to 9d55ce1.

Revert "[skip-ci] Update artifacts"

This reverts commit 826a784.

update grafana dashboard #major

[skip-ci] Update artifacts

Revert "Update grafana dashboard #major (#305)"

This reverts commit a3bec38, reversing
changes made to 31225c1.

Revert "[skip-ci] Update artifacts"

This reverts commit e824950.

granfana updates

[skip-ci] Update artifacts
  • Loading branch information
stakater-nordmart-bot authored and AsfaMumtaz committed Mar 18, 2024
1 parent 9d55ce1 commit f499589
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

All notable changes to this project will be documented here.

### v3.0.0
- 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)

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ Stakater [IngressMonitorController](https://github.com/stakater/IngressMonitorCo
| 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 | `[]` |
| grafanaDashboard.contents.key.datasources | maps required data sources to existing ones | `{}` |

### CronJob Parameters

Expand Down
2 changes: 1 addition & 1 deletion application/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application

# Helm chart Version

version: 2.3.3
version: 3.0.0


keywords:
Expand Down
28 changes: 23 additions & 5 deletions application/templates/grafanadashboard.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,47 @@
{{- if and (.Values.grafanaDashboard).enabled (.Capabilities.APIVersions.Has "integreatly.org/v1alpha1") -}}
{{- if and (.Values.grafanaDashboard).enabled (.Capabilities.APIVersions.Has "grafana.integreatly.org/v1beta1") -}}
{{- range $name, $content := .Values.grafanaDashboard.contents }}
---
apiVersion: integreatly.org/v1alpha1
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
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:
{{- if $content.json }}
json:
json:
{{ $content.json | toJson }}
{{- end }}
{{- if $content.url }}
url: {{ $content.url }}
{{- end }}
{{- if $content.allowCrossNamespaceImport }}
allowCrossNamespaceImport: {{ $content.allowCrossNamespaceImport }}
{{- end }}
{{- if $content.folder }}
folder: {{ $content.folder }}
{{- end }}
{{- if $content.instanceSelector }}
instanceSelector:
{{ toYaml $content.instanceSelector | indent 4 }}
{{- end }}
{{- if $content.configMapRef }}
configMapRef:
{{ toYaml $content.configMapRef | indent 4 }}
{{- end }}
{{- if $content.datasources }}
datasources:
{{ toYaml $content.datasources | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
13 changes: 12 additions & 1 deletion application/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,18 @@ grafanaDashboard:
"uid": "OmHEcaFZz",
"version": 3
}
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

cronJob:
enabled: true
Expand Down
12 changes: 12 additions & 0 deletions application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f499589

Please sign in to comment.