Skip to content

Commit 4391487

Browse files
committed
Incorporated CO + PM Feedback + Other Fixes
1 parent 207ff56 commit 4391487

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/user-guide/resource-watcher.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,29 @@ Here, you can select the exact Kubernetes resource(s) you wish to track for chan
6666

6767
* Choose the event type your watcher should listen to: `Created`, `Updated`, `Deleted`.
6868

69-
* Enter a [CEL expression](https://github.com/google/cel-spec/blob/master/doc/langdef.md) to catch a specific change in the resource's manifest.
69+
| Event Type | Description |
70+
| ---------- | ----------------------------------------------------------------------- |
71+
| Created | Triggers the watcher when your Kubernetes resource is created |
72+
| Updated | Triggers the watcher when your existing Kubernetes resource is modified |
73+
| Deleted | Triggers the watcher when your existing Kubernetes resource is deleted |
7074

71-
**Example**: `DEVTRON_FINAL_MANIFEST.status.currentReplicas == DEVTRON_FINAL_MANIFEST.spec.MaxReplicas`
75+
* Enter a [CEL expression](https://github.com/google/cel-spec/blob/master/doc/langdef.md) to catch a specific change in the resource's manifest.
7276

7377
{% hint style="info" %}
74-
* **If Resource Is Created** - Use 'DEVTRON_FINAL_MANIFEST'
75-
* **If Resource Is Updated** - Both 'DEVTRON_INITIAL_MANIFEST' and 'DEVTRON_FINAL_MANIFEST' can exist
76-
* **If Resource Is Deleted** - Use 'DEVTRON_FINAL_MANIFEST'
78+
* **If resource is created** - Use 'DEVTRON_FINAL_MANIFEST'
79+
* **If resource is updated** - Both 'DEVTRON_INITIAL_MANIFEST' and 'DEVTRON_FINAL_MANIFEST' can exist
80+
* **If resource is deleted** - Use 'DEVTRON_INITIAL_MANIFEST'
7781
{% endhint %}
7882

83+
**Example**: `DEVTRON_FINAL_MANIFEST.status.currentReplicas == DEVTRON_FINAL_MANIFEST.spec.maxReplicas`
84+
7985
### Execute Runbook
8086

8187
Here, you can choose a job that should trigger if your watcher intercepts any changes.
8288

8389
![Figure 7: Choosing a Job to Trigger](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/resource-watcher/execute-runbook.gif)
8490

85-
* Choose a job pipeline from the **Run Devtron Job pipeline** dropdown.
91+
* Choose a job pipeline from the **Run Devtron Job pipeline** dropdown. If a pipeline is not selected, the watcher won't intercept matching resource changes even if your defined conditions are met.
8692

8793
* Select the environment in which the job should run. It can either be `devtron-ci` or the source environment (the intercepted namespace where the event has occurred).
8894

@@ -158,7 +164,7 @@ A live streaming sports application experiences a surge in viewers during a majo
158164

159165
1. Create a watcher named 'Live Stream Scaling Alert'.
160166
2. Monitor updates to HPA resource in the application's namespace.
161-
3. When `currentReplicas` count reaches `MaxReplicas`, trigger a job that contains the script to increase the replica count.
167+
3. When `currentReplicas` count reaches `maxReplicas`, trigger a job that contains the script to increase the replica count.
162168

163169
### Pod Health Monitoring
164170

0 commit comments

Comments
 (0)