From 73902a73efc7908218e6d7d3d448981884161a37 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Wed, 29 Jun 2022 18:00:01 +0200 Subject: [PATCH] chore(helm): Update configs Signed-off-by: rjshrjndrn --- .../helmcharts/manifests/.cache_ggshield | 1 + ee/scripts/helmcharts/manifests/logging.yaml | 9 - .../helmcharts/manifests/monitoring.yaml | 155 ++++++++++++++++++ 3 files changed, 156 insertions(+), 9 deletions(-) create mode 100644 ee/scripts/helmcharts/manifests/.cache_ggshield diff --git a/ee/scripts/helmcharts/manifests/.cache_ggshield b/ee/scripts/helmcharts/manifests/.cache_ggshield new file mode 100644 index 000000000..57bd9f38c --- /dev/null +++ b/ee/scripts/helmcharts/manifests/.cache_ggshield @@ -0,0 +1 @@ +{"last_found_secrets": [{"name": "Generic High Entropy Secret - scripts/helm/app/chalice.yaml", "match": "1d1def20af0fd776f96e7d895df8731480019980c238549df0afe4280803b81a"}]} \ No newline at end of file diff --git a/ee/scripts/helmcharts/manifests/logging.yaml b/ee/scripts/helmcharts/manifests/logging.yaml index 422aa0594..659fcccfe 100644 --- a/ee/scripts/helmcharts/manifests/logging.yaml +++ b/ee/scripts/helmcharts/manifests/logging.yaml @@ -14,15 +14,6 @@ config: store: inmemory replication_factor: 1 - ## Different ring configs can be used. E.g. Consul - # ring: - # store: consul - # replication_factor: 1 - # consul: - # host: "consul:8500" - # prefix: "" - # http_client_timeout: "20s" - # consistent_reads: true limits_config: enforce_metric_name: false reject_old_samples: true diff --git a/ee/scripts/helmcharts/manifests/monitoring.yaml b/ee/scripts/helmcharts/manifests/monitoring.yaml index e69de29bb..5e17ecc45 100644 --- a/ee/scripts/helmcharts/manifests/monitoring.yaml +++ b/ee/scripts/helmcharts/manifests/monitoring.yaml @@ -0,0 +1,155 @@ +## Update the following values +domainName: &domainName openreplay.mycorp.org +credentials: + grafana: &grafana + adminPassword: "grafanaAdminPassword" + alertManager: &alertmanager + slack_api_url: "https://hooks.slack.com/services/xxxx/xxxx/xxxxx" + +## Custom configuration for Monitoring and logging stack +fullnameOverride: "openreplay" +grafana: + <<: *grafana + env: + GF_SERVER_ROOT_URL: http://grafana.local.com/grafana + additionalDataSources: + - name: loki + editable: true + type: loki + url: http://loki.logging:3100 + ingress: + enabled: true + ingressClassName: openreplay + hosts: + - *domainName + annotations: + nginx.ingress.kubernetes.io/rewrite-target: /$1 + path: /grafana/(.*) + tls: + - hosts: + - *domainName + secretName: openreplay-ssl + +prometheus: + prometheusSpec: + storageSpec: + volumeClaimTemplate: + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 200Gi +alertmanager: + config: + global: + resolve_timeout: 5m + <<: *alertmanager + route: + # group_by: ['job'] + group_by: ['alertname','container'] + group_wait: 30s + group_interval: 5m + repeat_interval: 12h + receiver: 'slack' + routes: + - match: + alertname: Watchdog + receiver: 'slack' + receivers: + - name: slack + slack_configs: + - channel: '${CHANGE_ME_SLACK_CHANNEL}' + color: '{{ template "slack.color" . }}' + title: '{{ template "slack.title" . }}' + text: '{{ template "slack.text" . }}' + send_resolved: true + actions: + - type: button + text: 'Runbook :green_book:' + url: '{{ (index .Alerts 0).Annotations.runbook_url }}' + # - type: button + # text: 'Query :mag:' + # url: '{{ (index .Alerts 0).GeneratorURL }}' + # - type: button + # text: 'Dashboard :chart_with_upwards_trend:' + # url: '{{ (index .Alerts 0).Annotations.dashboard_url }}' + # - type: button + # text: 'Silence :no_bell:' + # url: '{{ template "__alert_silence_link" . }}' + templates: + - /etc/alertmanager/config/*.tmpl + + templateFiles: + template_1.tmpl: |- + {{/* Alertmanager Silence link */}} + {{ define "__alert_silence_link" -}} + {{ .ExternalURL }}/#/silences/new?filter=%7B + {{- range .CommonLabels.SortedPairs -}} + {{- if ne .Name "alertname" -}} + {{- .Name }}%3D"{{- .Value -}}"%2C%20 + {{- end -}} + {{- end -}} + alertname%3D"{{- .CommonLabels.alertname -}}"%7D + {{- end }} + + {{/* Severity of the alert */}} + {{ define "__alert_severity" -}} + {{- if eq .CommonLabels.severity "critical" -}} + *Severity:* `Critical` + {{- else if eq .CommonLabels.severity "warning" -}} + *Severity:* `Warning` + {{- else if eq .CommonLabels.severity "info" -}} + *Severity:* `Info` + {{- else -}} + *Severity:* :question: {{ .CommonLabels.severity }} + {{- end }} + {{- end }} + + {{/* Title of the Slack alert */}} + {{ define "slack.title" -}} + [{{ .Status | toUpper -}} + {{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{- end -}} + ] {{ .CommonLabels.alertname }} + {{- end }} + + + {{/* Color of Slack attachment (appears as line next to alert )*/}} + {{ define "slack.color" -}} + {{ if eq .Status "firing" -}} + {{ if eq .CommonLabels.severity "warning" -}} + warning + {{- else if eq .CommonLabels.severity "critical" -}} + danger + {{- else -}} + #439FE0 + {{- end -}} + {{ else -}} + good + {{- end }} + {{- end }} + + {{/* The text to display in the alert */}} + {{ define "slack.text" -}} + + {{ template "__alert_severity" . }} + {{- if (index .Alerts 0).Annotations.summary }} + {{- "\n" -}} + *Summary:* {{ (index .Alerts 0).Annotations.summary }} + {{- end }} + + {{ range .Alerts }} + + {{- if .Annotations.description }} + {{- "\n" -}} + {{ .Annotations.description }} + {{- "\n" -}} + {{- end }} + {{- if .Annotations.message }} + {{- "\n" -}} + {{ .Annotations.message }} + {{- "\n" -}} + {{- end }} + + {{- end }} + + {{- end }}