Skip to content

Commit 1823ae5

Browse files
committed
feat(KFLUXUI-592): improve the Readme.md for system alerts and yaml files
1 parent f03b748 commit 1823ae5

File tree

30 files changed

+79
-181
lines changed

30 files changed

+79
-181
lines changed

components/konflux-info/README.md

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ The `KONFLUX-INFO` directory contains:
66

77
```bash
88
.
9-
├── auto-alert-schema.json # JSON shema definition for auto-alert-content.yaml
109
├── base/ # Common resources (e.g., RBAC)
1110
├── production/ # Production cluster configurations
1211
├── staging/ # Staging cluster configurations
@@ -18,10 +17,10 @@ Each cluster directory contains:
1817

1918
```bash
2019
.
21-
├── auto-alerts # The directory manages auto-generated alerts content shown in the UI
20+
├── system-alerts # The directory manages auto-generated alerts content shown in the UI
2221
├── banner-content.yaml # The banner content shown in the UI
2322
├── info.json # Metadata about the cluster
24-
└── kustomization.yaml # Kustomize configuration for this cluster, including base, auto-alerts, and other configs
23+
└── kustomization.yaml # Kustomize configuration for this cluster, including base, system-alerts, and other configs
2524

2625
```
2726

@@ -230,41 +229,83 @@ When there are no events to announce:
230229
Purpose: Release announcement for Konflux 1.2
231230
```
232231
233-
## 📢 Auto Alerts(WIP)
232+
---
233+
234+
## 📢 System Alerts
234235
235236
We enables the infrastructure team to automatically surface specific operational issues or warnings in the Konflux UI.
236237
237238
These alerts would be auto-generated from monitoring systems or automation scripts, written as Kubernetes ConfigMaps, and automatically picked up by the Konflux UI to inform users of system-wide conditions.
238239
239240
### ✅ Alert YAML Format
240241
241-
Each file under auto-alerts/ must be a valid Kubernetes ConfigMap, including at minimum:
242+
Each file under `system-alerts/` must be a valid Kubernetes ConfigMap and would be considered as one alert.
243+
244+
We use below simple JSON format inside the ConfigMap to make generation via scripts easier and more reliable:
245+
246+
- Only two fields are supported in the alert content:
247+
248+
- summary: A short, user-facing message.
249+
- type: One of info, warning, or danger.
250+
251+
- JSON is used instead of YAML for ease of script generation.
252+
253+
- The label `konflux.system.alert: "true"` is required — this is how the Konflux UI discovers and filters alert ConfigMaps.
254+
255+
Here is an example:
242256
243257
```yaml
244258
apiVersion: v1
245259
kind: ConfigMap
246260
metadata:
247-
name: konflux-auto-alert-xyz
261+
name: konflux-system-alert-xyz
248262
namespace: konflux-info
249263
labels:
250-
konflux-auto-alert: "true" # Required. UI filter alerts out by this label.
264+
konflux.system.alert: "true"
251265
data:
252-
auto-alert-content.yaml: |
253-
enable: true
254-
summary: "Builds are delayed due to maintenance"
255-
type: "warning"
266+
system-alert-content.json: |
267+
{
268+
"summary": "Builds are delayed due to maintenance",
269+
"type": "warning"
270+
}
256271
```
257272
258-
🔐 The data.banner-content.yaml should follow the schema defined in `auto-alert-schema.json`
273+
Note there is no CI validation for the `system-alert-content.json` payload.
259274

260275
### Folder Structure
261276

277+
When there are active alerts, the folder structure is:
278+
262279
```bash
263280
264-
auto-alerts/ # Alert ConfigMaps (one file = one alert)
281+
system-alerts/ # Alert ConfigMaps (one file = one alert)
265282
.
266-
├── alert-1.yaml # Fully valid ConfigMap YAML
283+
├── alert-1.yaml # A example valid ConfigMap containing alert content
267284
├── alert-2.yaml
268-
└── kustomization.yaml # Auto-generated, includes all alert YAMLs
285+
└── kustomization.yaml # Auto-generated, includes all alert YAMLs
269286
270287
```
288+
289+
When there are no alerts, the `system-alerts/` folder and its reference in the parent `kustomization.yaml` should be both removed automatically to avoid kustomize errors.
290+
291+
### When to Add or Remove an Alert
292+
293+
These ConfigMaps are automatically generated by monitoring or scripting systems based on the current system state.
294+
295+
- Add an alert
296+
297+
- A new YAML file should be generated under `system-alerts` when a new system condition or issue needs to be surfaced to users.
298+
- `kustomization.yaml` under `system-alerts` should be refreshed to ensure the new YAML file is covered.
299+
- If the `system-alerts/` directory does not exist (e.g. no previous alerts), you must:
300+
- Create the `system-alerts/` directory.
301+
- Generate its local `kustomization.yaml`
302+
- Ensure the parent kustomization.yaml includes a reference to `system-alerts/`.
303+
304+
- To remove an alert:
305+
- Delete the corresponding alert YAML file from `system-alerts/.`
306+
- `kustomization.yaml` under `system-alerts` should be refreshed to ensure the deleted YAML has been removed.
307+
- If no alerts remain:
308+
- Delete the `system-alerts/` directory.
309+
- Remove its reference from the parent `kustomization.yaml`.
310+
311+
⚙️ These add/remove actions are expected to be handled by automation. Manual edits are discouraged unless for emergency override or debugging purposes.

components/konflux-info/auto-alert-schema.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

components/konflux-info/base/rbac.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ rules:
88
- get
99
apiGroups:
1010
- ''
11-
resourceNames:
12-
- konflux-public-info
13-
- konflux-banner-configmap
1411
resources:
1512
- configmaps
1613
---

components/konflux-info/production/kflux-ocp-p01/auto-alerts/kustomization.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[]
1+
[]

components/konflux-info/production/kflux-ocp-p01/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
44
- ../../base
5-
- auto-alerts
65

76
generatorOptions:
8-
disableNameSuffixHash: true
7+
disableNameSuffixHash: true
98

109
configMapGenerator:
1110
- name: konflux-public-info

components/konflux-info/production/kflux-prd-rh02/auto-alerts/auto-alert-1.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/konflux-info/production/kflux-prd-rh02/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
44
- ../../base
5-
- auto-alerts
65

76
generatorOptions:
8-
disableNameSuffixHash: true
7+
disableNameSuffixHash: true
98

109
configMapGenerator:
1110
- name: konflux-public-info

components/konflux-info/production/kflux-prd-rh03/kustomization.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
44
- ../../base
5-
- auto-alerts
65

76
generatorOptions:
8-
disableNameSuffixHash: true
7+
disableNameSuffixHash: true
98

109
configMapGenerator:
1110
- name: konflux-public-info

components/konflux-info/production/kflux-rhel-p01/auto-alerts/auto-alert-1.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)