Skip to content

Commit d11afaf

Browse files
committed
docs: improve session alerts page
1 parent 5a224f2 commit d11afaf

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

docs/docs/20-admins/30-operation/100-session-alerts.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ title: Session Alerts
44

55
Renku can receive alerts and display them to users within the Renku session interface. This allows users to be alerted to issues with their active sessions, such as high memory usage, low disk space, or out-of-memory kills.
66

7-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M1 3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h4.586a1 1 0 0 0 .707-.293l.353-.353a.5.5 0 0 1 .708 0l.353.353a1 1 0 0 0 .707.293H15a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zm.5 1h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5m5 0h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5m4.5.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5zM2 10v2H1v-2zm2 0v2H3v-2zm2 0v2H5v-2zm3 0v2H8v-2zm2 0v2h-1v-2zm2 0v2h-1v-2zm2 0v2h-1v-2z"/></svg>
8-
97
## Overview
108

119
In addition to dedicated endpoints for creating, listing, and resolving alerts, Renku has built-in support for handling alerts sent from Prometheus Alertmanager via a webhook integration. Support for other alerting systems may be added in the future.
@@ -45,26 +43,26 @@ The integration works as follows:
4543

4644
## Prerequisites
4745

48-
Prometheus and Alertmanager deployed in your cluster
49-
Renku Data Services with the alerts feature enabled
46+
- [Prometheus](https://prometheus.io/) with [Prometheus Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/) and [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics) deployed in your cluster
47+
- Renku deployed in your cluster with the `alerts.alertmanager.enabled=true` Helm value set
5048

5149
## Setting up Alertmanager Webhook Integration
5250

5351
The following steps configure Alertmanager to send session-related alerts to Renku.
5452

5553
### OAuth2 Authentication
5654

57-
The Alertmanager webhook endpoint requires authentication using OAuth2 client credentials. An initialization script has already created:
55+
The Alertmanager webhook endpoint requires authentication using OAuth2 client credentials. An initialization script has already created the following Keycloak resources in the `Renku` realm:
5856

59-
- alertmanager OAuth2 client: Enables Alertmanager to authenticate webhook requests to Renku Data Services
60-
- alertmanager-webhook realm role: Assigned to the client's service account to control access to the webhook endpoint
61-
- Token audience configuration: The client is configured to include "renku" in the token audience claim, as required by Renku Data Services
57+
- `alertmanager-webhook` OAuth2 client: Enables Alertmanager to authenticate webhook requests to Renku Data Services
58+
- `alertmanager-webhook` realm role: Assigned to the client's service account to control access to the webhook endpoint
59+
- Token audience configuration: The client is configured to include `renku` in the token audience claim
6260

6361
You will need the client secret from this client to proceed.
6462

6563
## Step 1: Store the Client Secret in Kubernetes
6664

67-
Create a Kubernetes secret for the OAuth2 client secret:
65+
Create a Kubernetes secret for the OAuth2 client secret in the namespace where Prometheus Alertmanager is deployed (e.g., `monitoring`):
6866

6967
```bash
7068
kubectl create secret generic alertmanager-oauth2-secret \
@@ -76,7 +74,7 @@ kubectl create secret generic alertmanager-oauth2-secret \
7674

7775
### Mount the Secret
7876

79-
Add the secret mount to your Prometheus Helm values:
77+
Add the secret mount for the secret you created in step 1 to your Prometheus Helm values:
8078

8179
```yaml
8280
alertmanager:
@@ -105,7 +103,7 @@ alertmanager:
105103
max_alerts: 1
106104
http_config:
107105
oauth2:
108-
client_id: 'alertmanager'
106+
client_id: 'alertmanager-webhook'
109107
client_secret_file: '/etc/alertmanager/secrets/oauth2-client-secret'
110108
token_url: 'https://your-renku-instance.com/auth/realms/Renku/protocol/openid-connect/token'
111109

@@ -153,15 +151,17 @@ Alert rules must include specific labels and annotations for Renku to process th
153151

154152
### Required Labels
155153

156-
- `safe_username`: Keycloak user ID of the user to notify (required)
157-
- `statefulset`: Session name (required)
154+
- `safe_username`: Keycloak user ID of the alert recipient
155+
- `statefulset`: Name of the AmaltheaSession statefulset in question
158156
- `purpose: renku-session`: Identifies this as a session alert (optional, used for alert routing)
159157

160158
### Required Annotations
161159

162160
- `title`: Alert title displayed to users (required)
163161
- `description`: Alert message body (required)
164162

163+
Descriptions can include markdown formatting.
164+
165165
### Example Alert Rules
166166

167167
#### High Memory Usage
@@ -258,7 +258,7 @@ Test the integration by sending a test alert:
258258
TOKEN=$(curl -X POST \
259259
"https://your-renku-instance.com/auth/realms/Renku/protocol/openid-connect/token" \
260260
-d "grant_type=client_credentials" \
261-
-d "client_id=alertmanager" \
261+
-d "client_id=alertmanager-webhook" \
262262
-d "client_secret=YOUR_CLIENT_SECRET" \
263263
| jq -r '.access_token')
264264
@@ -275,7 +275,7 @@ curl -X POST \
275275
"status": "firing",
276276
"labels": {
277277
"safe_username": "KEYCLOAK_USER_ID",
278-
"statefulset": "test-session"
278+
"statefulset": "SESSION_STATEFULSET_NAME",
279279
},
280280
"annotations": {
281281
"title": "Test Alert",

0 commit comments

Comments
 (0)