From 0baa23c8258bf6d088c6fb7318fa6ba7a3c8832a Mon Sep 17 00:00:00 2001 From: "thibault.raquet" Date: Thu, 26 Sep 2024 09:42:50 +0200 Subject: [PATCH 1/4] Upgrade flux alerts --- infrastructure/flux-resources/alerts.yaml | 74 +++++++++++++++++++ .../flux-resources/kustomization.yaml | 2 +- .../flux-resources/teams-alert.yaml | 33 --------- 3 files changed, 75 insertions(+), 34 deletions(-) create mode 100644 infrastructure/flux-resources/alerts.yaml delete mode 100644 infrastructure/flux-resources/teams-alert.yaml diff --git a/infrastructure/flux-resources/alerts.yaml b/infrastructure/flux-resources/alerts.yaml new file mode 100644 index 0000000..34067b9 --- /dev/null +++ b/infrastructure/flux-resources/alerts.yaml @@ -0,0 +1,74 @@ +--- +apiVersion: notification.toolkit.fluxcd.io/v1beta3 +kind: Provider +metadata: + name: msteams + namespace: flux-system +spec: + type: msteams + channel: "Flux CD - LDC_WEB" + secretRef: + name: msteams-url + +--- +apiVersion: notification.toolkit.fluxcd.io/v1beta3 +kind: Provider +metadata: + name: grafana + namespace: flux-system +spec: + type: grafana + address: "http://prometheus-stack-grafana.common-services.svc.cluster.local/api/annotations" + secretRef: + name: grafana-auth + +--- +apiVersion: notification.toolkit.fluxcd.io/v1beta3 +kind: Alert +metadata: + name: msteams + namespace: flux-system +spec: + summary: "LDC-WEB K8S ERROR" + eventMetadata: + env: ${CI_ENVIRONMENT_NAME} + cluster: ${KUBERNETES_SERVER_API} + region: ${KUBERNETES_REGION} + providerRef: + name: msteams + eventSeverity: info + exclusionList: + - "^Dependencies.*" + eventSources: + - kind: GitRepository + name: '*' + - kind: Kustomization + name: '*' + - kind: HelmRepository + name: '*' + - kind: HelmRelease + name: '*' + +--- +apiVersion: notification.toolkit.fluxcd.io/v1beta3 +kind: Alert +metadata: + name: grafana + namespace: flux-system +spec: + eventMetadata: + env: ${CI_ENVIRONMENT_NAME} + providerRef: + name: grafana + eventSeverity: info + exclusionList: + - "^Dependencies.*" + eventSources: + - kind: GitRepository + name: '*' + - kind: Kustomization + name: '*' + - kind: HelmRepository + name: '*' + - kind: HelmRelease + name: '*' diff --git a/infrastructure/flux-resources/kustomization.yaml b/infrastructure/flux-resources/kustomization.yaml index b384292..31fd06c 100644 --- a/infrastructure/flux-resources/kustomization.yaml +++ b/infrastructure/flux-resources/kustomization.yaml @@ -1,4 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - teams-alert.yaml + - alerts.yaml diff --git a/infrastructure/flux-resources/teams-alert.yaml b/infrastructure/flux-resources/teams-alert.yaml deleted file mode 100644 index 4d811da..0000000 --- a/infrastructure/flux-resources/teams-alert.yaml +++ /dev/null @@ -1,33 +0,0 @@ ---- -apiVersion: notification.toolkit.fluxcd.io/v1beta3 -kind: Provider -metadata: - name: msteams - namespace: flux-system -spec: - type: msteams - channel: "Flux CD - LDC_WEB" - secretRef: - name: msteams-url - ---- -apiVersion: notification.toolkit.fluxcd.io/v1beta3 -kind: Alert -metadata: - name: msteams - namespace: flux-system -spec: - providerRef: - name: msteams - eventSeverity: info - eventSources: - - kind: GitRepository - name: '*' - - kind: Kustomization - name: '*' - - kind: HelmRepository - name: '*' - - kind: HelmRelease - name: '*' - exclusionList: - - "^Dependencies.*" From 19562f60220b4d8292e4dc3bc4fa8d5eab4b332a Mon Sep 17 00:00:00 2001 From: "thibault.raquet" Date: Thu, 26 Sep 2024 09:57:30 +0200 Subject: [PATCH 2/4] Upgrade flux alerts --- infrastructure/flux-resources/alerts.yaml | 36 ----------------------- 1 file changed, 36 deletions(-) diff --git a/infrastructure/flux-resources/alerts.yaml b/infrastructure/flux-resources/alerts.yaml index 34067b9..02fb96b 100644 --- a/infrastructure/flux-resources/alerts.yaml +++ b/infrastructure/flux-resources/alerts.yaml @@ -10,18 +10,6 @@ spec: secretRef: name: msteams-url ---- -apiVersion: notification.toolkit.fluxcd.io/v1beta3 -kind: Provider -metadata: - name: grafana - namespace: flux-system -spec: - type: grafana - address: "http://prometheus-stack-grafana.common-services.svc.cluster.local/api/annotations" - secretRef: - name: grafana-auth - --- apiVersion: notification.toolkit.fluxcd.io/v1beta3 kind: Alert @@ -48,27 +36,3 @@ spec: name: '*' - kind: HelmRelease name: '*' - ---- -apiVersion: notification.toolkit.fluxcd.io/v1beta3 -kind: Alert -metadata: - name: grafana - namespace: flux-system -spec: - eventMetadata: - env: ${CI_ENVIRONMENT_NAME} - providerRef: - name: grafana - eventSeverity: info - exclusionList: - - "^Dependencies.*" - eventSources: - - kind: GitRepository - name: '*' - - kind: Kustomization - name: '*' - - kind: HelmRepository - name: '*' - - kind: HelmRelease - name: '*' From d086a8bf4cb3149a034c2c60ff74a15903b4eace Mon Sep 17 00:00:00 2001 From: "thibault.raquet" Date: Thu, 26 Sep 2024 10:00:16 +0200 Subject: [PATCH 3/4] Upgrade flux alerts --- infrastructure/flux-resources/alerts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/flux-resources/alerts.yaml b/infrastructure/flux-resources/alerts.yaml index 02fb96b..c1ef9f1 100644 --- a/infrastructure/flux-resources/alerts.yaml +++ b/infrastructure/flux-resources/alerts.yaml @@ -17,7 +17,7 @@ metadata: name: msteams namespace: flux-system spec: - summary: "LDC-WEB K8S ERROR" + summary: "LDC-WEB K8S NOTIFICATION" eventMetadata: env: ${CI_ENVIRONMENT_NAME} cluster: ${KUBERNETES_SERVER_API} From cfbc7dfd971e63fe5cdb97416e0ada750618e2f1 Mon Sep 17 00:00:00 2001 From: "thibault.raquet" Date: Thu, 26 Sep 2024 12:18:50 +0200 Subject: [PATCH 4/4] Update agents config --- .gitlab/agents/dev-k8s-ldc-web/config.yaml | 11 ++++- .gitlab/agents/k8s-ldc-web/config.yaml | 47 --------------------- .gitlab/agents/prod-k8s-ldc-web/config.yaml | 11 ++++- 3 files changed, 20 insertions(+), 49 deletions(-) delete mode 100644 .gitlab/agents/k8s-ldc-web/config.yaml diff --git a/.gitlab/agents/dev-k8s-ldc-web/config.yaml b/.gitlab/agents/dev-k8s-ldc-web/config.yaml index 244bbda..cdc5ecc 100644 --- a/.gitlab/agents/dev-k8s-ldc-web/config.yaml +++ b/.gitlab/agents/dev-k8s-ldc-web/config.yaml @@ -6,16 +6,22 @@ ci_access: - id: ldc-web/projets/domaine-de-lanvaux - id: ldc-web/projets/doux - id: ldc-web/projets/galina - - id: ldc-web/projets/gen-game-web-instances/reghalal-ramadan-2024 + - id: ldc-web/projets/gen-game-web-instances/janze + - id: ldc-web/projets/gen-game-web-instances/l-orleanais-jeu - id: ldc-web/projets/gen-game-web-instances/le-gaulois-tdf-2024 + - id: ldc-web/projets/gen-game-web-instances/normandie + - id: ldc-web/projets/gen-game-web-instances/reghalal-jeu - id: ldc-web/projets/gen-game-web-instances/tregalette-chandleur-2024 - id: ldc-web/projets/id-halal - id: ldc-web/projets/jeusselin - id: ldc-web/projets/l-hours - id: ldc-web/projets/la-toque-angevine + - id: ldc-web/projets/ldc-foods + - id: ldc-web/projets/ldc-restauration - id: ldc-web/projets/ldc-web - id: ldc-web/projets/le-gaulois - id: ldc-web/projets/le-gaulois-pro + - id: ldc-web/projets/les-fermiers-snv - id: ldc-web/projets/lionor - id: ldc-web/projets/loue - id: ldc-web/projets/loue-magie-de-noel @@ -36,6 +42,9 @@ ci_access: - id: ldc-web/projets/sbv - id: ldc-web/projets/share-secure-content - id: ldc-web/projets/showroom/showroom-bo + - id: ldc-web/projets/showroom-bo-instances/drosed + - id: ldc-web/projets/showroom-bo-instances/maitre-coq + - id: ldc-web/projets/showroom-bo-instances/nature-and-respect - id: ldc-web/projets/store-ldc - id: ldc-web/projets/support-web - id: ldc-web/projets/tregalette diff --git a/.gitlab/agents/k8s-ldc-web/config.yaml b/.gitlab/agents/k8s-ldc-web/config.yaml deleted file mode 100644 index 244bbda..0000000 --- a/.gitlab/agents/k8s-ldc-web/config.yaml +++ /dev/null @@ -1,47 +0,0 @@ -ci_access: - projects: - - id: ldc-web/projets/agis - - id: ldc-web/projets/crm - - id: ldc-web/projets/coupe-de-france-de-la-volaille - - id: ldc-web/projets/domaine-de-lanvaux - - id: ldc-web/projets/doux - - id: ldc-web/projets/galina - - id: ldc-web/projets/gen-game-web-instances/reghalal-ramadan-2024 - - id: ldc-web/projets/gen-game-web-instances/le-gaulois-tdf-2024 - - id: ldc-web/projets/gen-game-web-instances/tregalette-chandleur-2024 - - id: ldc-web/projets/id-halal - - id: ldc-web/projets/jeusselin - - id: ldc-web/projets/l-hours - - id: ldc-web/projets/la-toque-angevine - - id: ldc-web/projets/ldc-web - - id: ldc-web/projets/le-gaulois - - id: ldc-web/projets/le-gaulois-pro - - id: ldc-web/projets/lionor - - id: ldc-web/projets/loue - - id: ldc-web/projets/loue-magie-de-noel - - id: ldc-web/projets/mas-d-auge - - id: ldc-web/projets/matines - - id: ldc-web/projets/nature-and-respect - - id: ldc-web/projets/nature-eleveurs - - id: ldc-web/projets/op-insta-instances/le-gaulois - - id: ldc-web/projets/ovoteam - - id: ldc-web/projets/poule-et-toque - - id: ldc-web/projets/prims - - id: ldc-web/projets/qrcollector/qrcollector-back - - id: ldc-web/projets/qrcollector/qrcollector-front - - id: ldc-web/projets/regalette - - id: ldc-web/projets/reghalal - - id: ldc-web/projets/report - - id: ldc-web/projets/rgpd - - id: ldc-web/projets/sbv - - id: ldc-web/projets/share-secure-content - - id: ldc-web/projets/showroom/showroom-bo - - id: ldc-web/projets/store-ldc - - id: ldc-web/projets/support-web - - id: ldc-web/projets/tregalette - - id: ldc-web/projets/vdme - - id: ldc-web/projets/volena - -observability: - logging: - level: debug diff --git a/.gitlab/agents/prod-k8s-ldc-web/config.yaml b/.gitlab/agents/prod-k8s-ldc-web/config.yaml index 244bbda..cdc5ecc 100644 --- a/.gitlab/agents/prod-k8s-ldc-web/config.yaml +++ b/.gitlab/agents/prod-k8s-ldc-web/config.yaml @@ -6,16 +6,22 @@ ci_access: - id: ldc-web/projets/domaine-de-lanvaux - id: ldc-web/projets/doux - id: ldc-web/projets/galina - - id: ldc-web/projets/gen-game-web-instances/reghalal-ramadan-2024 + - id: ldc-web/projets/gen-game-web-instances/janze + - id: ldc-web/projets/gen-game-web-instances/l-orleanais-jeu - id: ldc-web/projets/gen-game-web-instances/le-gaulois-tdf-2024 + - id: ldc-web/projets/gen-game-web-instances/normandie + - id: ldc-web/projets/gen-game-web-instances/reghalal-jeu - id: ldc-web/projets/gen-game-web-instances/tregalette-chandleur-2024 - id: ldc-web/projets/id-halal - id: ldc-web/projets/jeusselin - id: ldc-web/projets/l-hours - id: ldc-web/projets/la-toque-angevine + - id: ldc-web/projets/ldc-foods + - id: ldc-web/projets/ldc-restauration - id: ldc-web/projets/ldc-web - id: ldc-web/projets/le-gaulois - id: ldc-web/projets/le-gaulois-pro + - id: ldc-web/projets/les-fermiers-snv - id: ldc-web/projets/lionor - id: ldc-web/projets/loue - id: ldc-web/projets/loue-magie-de-noel @@ -36,6 +42,9 @@ ci_access: - id: ldc-web/projets/sbv - id: ldc-web/projets/share-secure-content - id: ldc-web/projets/showroom/showroom-bo + - id: ldc-web/projets/showroom-bo-instances/drosed + - id: ldc-web/projets/showroom-bo-instances/maitre-coq + - id: ldc-web/projets/showroom-bo-instances/nature-and-respect - id: ldc-web/projets/store-ldc - id: ldc-web/projets/support-web - id: ldc-web/projets/tregalette