Skip to content

Commit d65b294

Browse files
authored
Use custom AlertManagerConfig (#421)
* Use custom AlertManagerConfig * Add new alert deploy * use 'develop' * fixup: extension
1 parent fe9b6b8 commit d65b294

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

.github/workflows/alert-deploy.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ on:
88
paths:
99
- '.nais/alerts.yaml'
1010
- '.github/workflows/alert-deploy.yaml'
11+
workflow_dispatch:
1112
permissions:
1213
id-token: write
14+
env:
15+
TEAM: dapla-stat
1316

1417
jobs:
1518
test-deploy:
@@ -18,22 +21,44 @@ jobs:
1821
steps:
1922
- name: Checkout code
2023
uses: actions/checkout@v4
24+
25+
- uses: actions/checkout@v4
26+
name: Retrieve AlertManager configuration
27+
with:
28+
repository: "statisticsnorway/nais-alert-config"
29+
path: "ext_alertconfig"
30+
sparse-checkout: |
31+
alertconfig.yaml
32+
sparse-checkout-cone-mode: false
33+
2134
- name: Deploy to test
2235
uses: nais/deploy/actions/deploy@v2
2336
env:
2437
CLUSTER: test
25-
RESOURCE: .nais/alerts.yaml
38+
RESOURCE: .nais/alerts.yaml,ext_alertconfig/alertconfig.yaml
2639
DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443
27-
40+
VAR: cluster=test,team=${{ env.team }}
41+
2842
prod-deploy:
2943
name: Deploy alerts to prod
3044
runs-on: ubuntu-latest
3145
steps:
3246
- name: Checkout code
3347
uses: actions/checkout@v4
48+
49+
- uses: actions/checkout@v4
50+
name: Retrieve AlertManager configuration
51+
with:
52+
repository: "statisticsnorway/nais-alert-config"
53+
path: "ext_alertconfig"
54+
sparse-checkout: |
55+
alertconfig.yaml
56+
sparse-checkout-cone-mode: false
57+
3458
- name: Deploy to prod
3559
uses: nais/deploy/actions/deploy@v2
3660
env:
3761
CLUSTER: prod
38-
RESOURCE: .nais/alerts.yaml
62+
RESOURCE: .nais/alerts.yaml,ext_alertconfig/alertconfig.yaml
3963
DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443
64+
VAR: cluster=prod,team=${{ env.team }}

.nais/alerts.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ spec:
2020
service: dapla-ctrl
2121
namespace: dapla-stat
2222
severity: critical
23+
alertmanager_custom_config: dapla-stat
24+
alert_type: custom
2325

2426
- alert: Dapla Ctrl is unavailable
2527
expr: kube_deployment_status_replicas_available{deployment="dapla-ctrl"} == 0
@@ -31,3 +33,5 @@ spec:
3133
service: dapla-ctrl
3234
namespace: dapla-stat
3335
severity: critical
36+
alertmanager_custom_config: dapla-stat
37+
alert_type: custom

0 commit comments

Comments
 (0)