From bc01ccf3ca40abed1cc9573b9605dbe72aeb237c Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Thu, 26 Sep 2024 15:04:54 +0200 Subject: [PATCH] chore(base-cluster): formatting --- .../monitoring/deadMansSwitch/hook-secret.yaml | 16 ++++++++-------- .../_alertmanager-config.yaml | 10 ++++++---- .../kube-prometheus-stack/_grafana-config.yaml | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/charts/base-cluster/templates/monitoring/deadMansSwitch/hook-secret.yaml b/charts/base-cluster/templates/monitoring/deadMansSwitch/hook-secret.yaml index ec5c2de56..278eca1ec 100644 --- a/charts/base-cluster/templates/monitoring/deadMansSwitch/hook-secret.yaml +++ b/charts/base-cluster/templates/monitoring/deadMansSwitch/hook-secret.yaml @@ -1,15 +1,15 @@ {{- if .Values.monitoring.deadMansSwitch.enabled -}} {{- $secret := include (print .Template.BasePath "/monitoring/deadMansSwitch/secret.yaml") . | fromYaml -}} - {{- $secret = mustMerge ( - dict "metadata" ( - dict "annotations" (dict - "helm.sh/hook" "pre-install,pre-upgrade,pre-delete" - "helm.sh/hook-delete-policy" "before-hook-creation,hook-succeeded,hook-failed" - ) - "namespace" .Release.Namespace + {{- $secret = mustMerge (dict + "metadata" (dict + "annotations" (dict + "helm.sh/hook" "pre-install,pre-upgrade,pre-delete" + "helm.sh/hook-delete-policy" "before-hook-creation,hook-succeeded,hook-failed" ) + "namespace" .Release.Namespace ) - $secret + ) + $secret -}} {{- toYaml $secret -}} {{- end -}} diff --git a/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_alertmanager-config.yaml b/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_alertmanager-config.yaml index 8b975c97f..28394f314 100644 --- a/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_alertmanager-config.yaml +++ b/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_alertmanager-config.yaml @@ -41,7 +41,8 @@ config: {{- $receivers := dict "null" (dict) -}} {{- if .Values.monitoring.prometheus.alertmanager.receivers.pagerduty.enabled -}} {{- $receivers = set $receivers "pagerduty" (dict - "pagerduty_configs" (list (dict + "pagerduty_configs" (list + (dict "routing_key" (.Values.monitoring.prometheus.alertmanager.receivers.pagerduty.integrationKey | required "You need to provide the `.Values.monitoring.prometheus.alertmanager.receivers.pagerduty.integrationKey`") "send_resolved" true "http_config" (dict "follow_redirects" true) @@ -52,7 +53,8 @@ config: {{- end -}} {{- if and .Values.monitoring.deadMansSwitch.enabled .Values.global.baseDomain .Values.global.clusterName -}} {{- $receivers = set $receivers "healthchecks.io" (dict - "webhook_configs" (list (dict + "webhook_configs" (list + (dict "url" (printf "https://hc-ping.com/%s/k8s-cluster-%s-%s-monitoring" .Values.monitoring.deadMansSwitch.pingKey (.Values.global.baseDomain | replace "." "-") .Values.global.clusterName) "send_resolved" false ) @@ -64,13 +66,13 @@ config: {{- range $name, $receiver := $receivers -}} {{- $receiversList = append $receiversList (mustMerge (dict "name" $name) $receiver) -}} {{- end }} - receivers: {{- $receiversList | toYaml | nindent 4 }} + receivers: {{- toYaml $receiversList | nindent 4 }} route: {{- if hasKey $receivers "pagerduty" }} receiver: pagerduty {{- end }} {{- $routes := list (dict "match" (dict "alertname" "InfoInhibitor") "receiver" "null") -}} {{- $routes = append $routes (dict "match" (dict "alertname" "Watchdog") "receiver" (hasKey $receivers "healthchecks.io" | ternary "healthchecks.io" "null") "group_interval" "1m" "repeat_interval" "1m") }} - routes: {{- $routes | toYaml | nindent 6 }} + routes: {{- toYaml $routes | nindent 6 }} {{- else }} enabled: false {{- end }} diff --git a/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_grafana-config.yaml b/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_grafana-config.yaml index 8fa2a69dc..bbce78e8c 100644 --- a/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_grafana-config.yaml +++ b/charts/base-cluster/templates/monitoring/kube-prometheus-stack/_grafana-config.yaml @@ -79,7 +79,7 @@ dashboardProviders: dashboardproviders.yaml: apiVersion: 1 providers: - - name: 'custom' + - name: custom orgId: 1 folder: '' type: file @@ -188,7 +188,7 @@ envValueFrom: {{- end }} {{- end }} {{- if $grafanaIni }} -grafana.ini: {{- $grafanaIni | toYaml | nindent 2 }} +grafana.ini: {{- toYaml $grafanaIni | nindent 2 }} {{- end }} downloadDashboards: securityContext: {{- include "base-cluster.prometheus-stack.containerSecurityContext" (dict) | nindent 4 }}