Skip to content

Commit

Permalink
chore(base-cluster): formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cwrau committed Sep 26, 2024
1 parent e27918b commit 6f0e22c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -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 -}}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
)
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ dashboardProviders:
dashboardproviders.yaml:
apiVersion: 1
providers:
- name: 'custom'
- name: custom
orgId: 1
folder: ''
type: file
Expand Down Expand Up @@ -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 }}
Expand Down

0 comments on commit 6f0e22c

Please sign in to comment.