Skip to content

Commit

Permalink
Update: monitoring mixins set to v1.10.0 for fluxcd-mixin
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <nlamirault@users.noreply.github.com>
  • Loading branch information
nlamirault committed May 27, 2024
1 parent f5e65d7 commit 37e6edc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/fluxcd-mixin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ keywords:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.2.0
version: 1.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
3 changes: 3 additions & 0 deletions charts/fluxcd-mixin/templates/alerts.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if .Values.monitor.enabled -}}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
Expand All @@ -8,6 +9,7 @@ metadata:
{{- include "fluxcd-mixin.annotations" . | indent 4 }}
labels:
{{- include "fluxcd-mixin.labels" . | indent 4 }}
app.kubernetes.io/component: metrics
{{- if .Values.monitor.additionalLabels }}
{{- toYaml .Values.monitor.additionalLabels | nindent 4 }}
{{- end }}
Expand All @@ -24,3 +26,4 @@ spec:
for: 10m
labels:
severity: warning
{{- end }}
36 changes: 31 additions & 5 deletions charts/fluxcd-mixin/templates/configmap-dashboards.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,50 @@
---
{{ if .Values.grafanaDashboard.enabled -}}
{{- $files := .Files.Glob "dashboards/*.json" }}
{{- if $files }}
---
apiVersion: v1
kind: ConfigMapList
items:
{{- range $path, $fileContents := $files }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" | lower }}
- apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "dashboard-fluxcd-mixin-%s" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ include "fluxcd-mixin.namespace" $ }}
annotations:
grafana-folder: {{ $.Values.grafana.folder }}
grafana-folder: {{ $.Values.grafanaDashboard.folder }}
{{- include "fluxcd-mixin.annotations" $ | indent 6 }}
labels:
grafana-dashboard: {{ $dashboardName }}
{{- include "fluxcd-mixin.labels" $ | indent 6 }}
app.kubernetes.io/component: dashboard
name: {{ printf "dashboard-%s" $dashboardName | trunc 63 | trimSuffix "-" }}
namespace: {{ include "fluxcd-mixin.namespace" $ }}
data:
{{ $dashboardName }}.json: |-
{{ $.Files.Get $path | indent 6}}
{{- end }}
{{ if $.Values.grafanaDashboard.grafanaOperator.enabled -}}
{{- range $path, $fileContents := $files }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDashboard
metadata:
labels:
{{- include "fluxcd-mixin.labels" $ | indent 4 }}
app.kubernetes.io/component: dashboard
name: {{ printf "%s" $dashboardName | trunc 63 | trimSuffix "-" | lower }}
namespace: {{ $.Release.Namespace }}
spec:
allowCrossNamespaceImport: {{ $.Values.grafanaDashboard.grafanaOperator.allowCrossNamespaceImport }}
folder: {{ $.Values.grafanaDashboard.folder }}
instanceSelector:
matchLabels:
{{- toYaml $.Values.grafanaDashboard.grafanaOperator.matchLabels | nindent 6 }}
configMapRef:
name: {{ printf "dashboard-%s" $dashboardName | trunc 63 | trimSuffix "-" }}
key: {{ $dashboardName }}.json
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 37e6edc

Please sign in to comment.