From 1d6fb878081312712db606acc27a2315d999830f Mon Sep 17 00:00:00 2001 From: Nguyen Minh Tuan Date: Mon, 11 Nov 2024 07:47:48 +0000 Subject: [PATCH] fix(prometheus): alertmanager discord webhook file https://github.com/prometheus/alertmanager/pull/3728 --- ...prometheus-manifests-k8s-cobi-tuana9a.yaml | 19 ++++++++++++++++ 100-argo-apps/300-prometheus.yaml | 2 +- .../alertmanager-secrets.yaml | 14 ++++++++++++ 300-prometheus/alertmanager-values.yaml | 22 +++++++++++++++++++ 300-prometheus/values.yaml | 14 +----------- 5 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 100-argo-apps/300-prometheus-manifests-k8s-cobi-tuana9a.yaml create mode 100644 300-prometheus-manfiests-k8s-cobi-tuana9a/alertmanager-secrets.yaml create mode 100644 300-prometheus/alertmanager-values.yaml diff --git a/100-argo-apps/300-prometheus-manifests-k8s-cobi-tuana9a.yaml b/100-argo-apps/300-prometheus-manifests-k8s-cobi-tuana9a.yaml new file mode 100644 index 0000000..0a3192d --- /dev/null +++ b/100-argo-apps/300-prometheus-manifests-k8s-cobi-tuana9a.yaml @@ -0,0 +1,19 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: 300-prometheus-manifests-k8s-cobi-tuana9a + namespace: argocd +spec: + project: default + revisionHistoryLimit: 10 + source: + path: 300-prometheus-manifests-k8s-cobi-tuana9a + repoURL: https://github.com/tuana9a/platform.git + targetRevision: main + destination: + namespace: prometheus + server: https://kubernetes.default.svc + syncPolicy: + automated: + prune: false + selfHeal: true diff --git a/100-argo-apps/300-prometheus.yaml b/100-argo-apps/300-prometheus.yaml index dc6061c..108f9bc 100644 --- a/100-argo-apps/300-prometheus.yaml +++ b/100-argo-apps/300-prometheus.yaml @@ -13,6 +13,7 @@ spec: releaseName: prometheus valueFiles: - $values/300-prometheus/values.yaml + - $values/300-prometheus/alertmanager-values.yaml - $values/300-prometheus/alert-values.yaml - $values/300-prometheus/alert-msg-template-values.yaml - repoURL: https://github.com/tuana9a/platform.git @@ -21,7 +22,6 @@ spec: destination: server: "https://kubernetes.default.svc" namespace: prometheus - # NOTE: wait https://github.com/prometheus/alertmanager/pull/3728 to be released syncPolicy: automated: prune: false diff --git a/300-prometheus-manfiests-k8s-cobi-tuana9a/alertmanager-secrets.yaml b/300-prometheus-manfiests-k8s-cobi-tuana9a/alertmanager-secrets.yaml new file mode 100644 index 0000000..9123479 --- /dev/null +++ b/300-prometheus-manfiests-k8s-cobi-tuana9a/alertmanager-secrets.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: discord-webhook-url +spec: + type: kv-v1 + mount: kv + path: kv/prometheus/alertmanager + destination: + name: discord-webhook-url + create: true + refreshAfter: 30s + vaultAuthRef: vault/secrets-operator \ No newline at end of file diff --git a/300-prometheus/alertmanager-values.yaml b/300-prometheus/alertmanager-values.yaml new file mode 100644 index 0000000..9231c7a --- /dev/null +++ b/300-prometheus/alertmanager-values.yaml @@ -0,0 +1,22 @@ +alertmanager: + image: + repository: quay.io/prometheus/alertmanager + pullPolicy: IfNotPresent + tag: "v0.28.0-rc.0" # fix https://github.com/prometheus/alertmanager/pull/3728 + persistence: + storageClass: nfs-vdb + size: 2Gi + config: + enabled: true + route: + receiver: "discord" + receivers: + - name: "discord" + discord_configs: + - webhook_url_file: /etc/discord_webhook_url.txt + extraSecretMounts: + - name: discord-webhook-url + mountPath: /etc + subPath: "discord_webhook_url.txt" + secretName: discord-webhook-url + readOnly: true diff --git a/300-prometheus/values.yaml b/300-prometheus/values.yaml index 58115e0..ae37e83 100644 --- a/300-prometheus/values.yaml +++ b/300-prometheus/values.yaml @@ -1,16 +1,4 @@ server: persistentVolume: storageClass: nfs-vdb - size: 15Gi -alertmanager: - persistence: - storageClass: nfs-vdb - size: 2Gi - config: - enabled: true - route: - receiver: "discord" - receivers: - - name: "discord" - discord_configs: - - webhook_url: "TODO" + size: 15Gi \ No newline at end of file