Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize label and annotation for Grafana dashboards #43

Merged
merged 6 commits into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/policy-reporter/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: monitoring
repository: ""
version: 1.3.0
version: 1.4.0
- name: ui
repository: ""
version: 1.7.0
- name: kyvernoPlugin
repository: ""
version: 0.4.0
digest: sha256:821f124786b218565a1d8473ed7331f2c84aa9cc7a271660f2702881fb85c1d4
generated: "2021-06-10T12:13:32.300743+02:00"
digest: sha256:a9d7eea930c844c76395d400e2f224f538e3f5e93a011926e31915f239509915
generated: "2021-06-26T22:23:24.195707238+02:00"
6 changes: 3 additions & 3 deletions charts/policy-reporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ description: |
It creates Prometheus Metrics and can send rule validation events to different targets like Loki, Elasticsearch, Slack or Discord

type: application
version: 1.7.3
appVersion: 1.7.0
version: 1.8.0
appVersion: 1.7.3

dependencies:
- name: monitoring
condition: monitoring.enabled
repository: ""
version: "1.3.0"
version: "1.4.0"
- name: ui
condition: ui.enabled
repository: ""
Expand Down
2 changes: 1 addition & 1 deletion charts/policy-reporter/charts/monitoring/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: monitoring
description: Policy Reporter Monitoring with predefined ServiceMonitor and Grafana Dashboards

type: application
version: 1.3.0
version: 1.4.0
fjogeleit marked this conversation as resolved.
Show resolved Hide resolved
appVersion: 0.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ kind: ConfigMap
metadata:
name: {{ include "monitoring.fullname" . }}-clusterpolicy-details-dashboard
namespace: {{ .Values.namespace }}
annotations:
{{ .Values.grafana.folder.annotation }}: {{ .Values.grafana.folder.name }}
labels:
grafana_dashboard: "1"
{{ .Values.grafana.dashboards.label }}: "1"
{{- include "monitoring.labels" . | nindent 4 }}
data:
cluster-policy-reporter-details-dashboard.json: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ kind: ConfigMap
metadata:
name: {{ include "monitoring.fullname" . }}-overview-dashboard
namespace: {{ .Values.namespace }}
annotations:
{{ .Values.grafana.folder.annotation }}: {{ .Values.grafana.folder.name }}
labels:
grafana_dashboard: "1"
{{ .Values.grafana.dashboards.label }}: "1"
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ kind: ConfigMap
metadata:
name: {{ include "monitoring.fullname" . }}-policy-details-dashboard
namespace: {{ .Values.namespace }}
annotations:
{{ .Values.grafana.folder.annotation }}: {{ .Values.grafana.folder.name }}
labels:
grafana_dashboard: "1"
{{ .Values.grafana.dashboards.label }}: "1"
{{- with .Values.serviceMonitor.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
10 changes: 10 additions & 0 deletions charts/policy-reporter/charts/monitoring/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ serviceMonitor:
# labels to match the serviceMonitorSelector of the Prometheus Resource
labels: {}

grafana:
dashboards:
# Label to find dashboards using the k8s sidecar
label: grafana_dashboard
folder:
# Annotation to enable folder storage using the k8s sidecar
annotation: grafana_folder
# Grafana folder in which to store the dashboards
name: Policy Reporter

policyReportDetails:
firstStatusRow:
height: 8
Expand Down