-
Notifications
You must be signed in to change notification settings - Fork 553
doc: Created Resource Watcher Doc #5193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5c8ef15
Created Resource Watcher Doc
ashoknayak777 d15b4be
Incorporated PM Feedback
ashoknayak777 da553ed
Variable Change + Fixes
ashoknayak777 207ff56
Variable Change + Fixes
ashoknayak777 4391487
Incorporated CO + PM Feedback + Other Fixes
ashoknayak777 eb0cf38
Merge branch 'main' into autoremediation-doc
ashoknayak777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| # Resource Watcher | ||
|
|
||
| ## Introduction [](https://devtron.ai/pricing) | ||
|
|
||
| An incident response if delayed can impact businesses, revenue, and waste valuable engineering time. Devtron's Resource Watcher enables you to perform automated actions upon the occurrence of events: | ||
|
|
||
| * **Create Event** - Occurs when a new Kubernetes resource is created, for e.g., a new pod spun up to handle increased traffic. | ||
| * **Update Event** - Occurs when an existing Kubernetes resource is modified, for e.g., deployment configuration tweaked to increase the replica count. | ||
| * **Delete Event** - Occurs when an existing Kubernetes resource is deleted, for e.g., deletion of an orphaned pod. | ||
|
|
||
| You can make the Resource Watcher listen to the above events and accordingly run a job you wish to get done, for e.g., increasing memory, executing a script, raising Jira ticket, emailing your stakeholders, sending Slack notifications, and many more. Since manual intervention is absent, the timely response of this auto-remediation system improves your operational efficiency. | ||
|
|
||
| --- | ||
|
|
||
| ## Creating a Watcher | ||
|
|
||
| {% hint style="warning" %} | ||
| ### Who Can Perform This Action? | ||
| Users need to have super-admin permission to create a watcher. | ||
| {% endhint %} | ||
|
|
||
| This page allows you to create a watcher to track events and run a job. It also shows the existing list of watchers (if any). | ||
|
|
||
| 1. Click **+ Create Watcher**. | ||
|
|
||
|  | ||
|
|
||
| 2. Creating a watcher consists of 4 parts, fill all the sections one by one: | ||
| * [Basic Details](#basic-details) | ||
| * [Namespaces to Watch](#namespaces-to-watch) | ||
| * [Intercept Change in Resources](#intercept-change-in-resources) | ||
| * [Execute Runbook](#execute-runbook) | ||
|
|
||
|  | ||
|
|
||
| ### Basic Details | ||
|
|
||
| Here, you can give a name and description to your watcher. | ||
|
|
||
|  | ||
|
|
||
| ### Namespaces to Watch | ||
|
|
||
| Here, you can select the [namespaces](../reference/glossary.md#namespace) whose [Kubernetes resource](../reference/glossary.md#objects) you wish to monitor for changes. | ||
|
|
||
| * You can watch the namespace(s) across **All Clusters** (existing and future). | ||
|
|
||
|  | ||
|
|
||
| * Or you can watch namespace(s) of **Specific Clusters**. | ||
|
|
||
|  | ||
|
|
||
| {% hint style="warning" %} | ||
| In both the above options, if you choose 'Specific Namespaces', you can further decide whether to track the namespaces you enter (by clicking 'Include selections') or to track the namespaces except the ones you enter (by clicking 'Exclude selections'). | ||
| {% endhint %} | ||
|
|
||
|
|
||
| ### Intercept Change in Resources | ||
|
|
||
| Here, you can select the exact Kubernetes resource(s) you wish to track for changes (in the namespace(s) you selected in the previous step). | ||
|
|
||
|  | ||
|
|
||
| * You can choose the resource from the **Resource kind(s) to watch** dropdown. Enter the link if it's a custom resource, for e.g., `install.istio.io/v1apha1/IstioOperator` | ||
|
|
||
| * Choose the event type your watcher should listen to: `Created`, `Updated`, `Deleted`. | ||
ashoknayak777 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| * (Optional) You may also 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. | ||
ashoknayak777 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Execute Runbook | ||
|
|
||
| Here, you can choose a job that should trigger if your watcher intercepts any changes. If you wish to simply intercept the changes and not perform any action, you may skip this section. | ||
ashoknayak777 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| * Choose a job pipeline from the **Run Devtron Job pipeline** dropdown. | ||
ashoknayak777 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| * 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). | ||
|
|
||
| * If the job expects input parameters, you may add its key and value under **Runtime input parameters**. You can also access the supported environment variables from the tooltip on the right. | ||
|
|
||
| Click **Create Watcher**. Your watcher is now ready to intercept the changes to the selected resources. | ||
|
|
||
| --- | ||
|
|
||
| ## Viewing Intercepted Changes | ||
|
|
||
| {% hint style="warning" %} | ||
| ### Who Can Perform This Action? | ||
| Users need to have super-admin permission to view intercepted changes. | ||
| {% endhint %} | ||
|
|
||
| This page allows you to view the changes to Kubernetes resources that you have selected for tracking changes. | ||
|
|
||
|  | ||
|
|
||
| It comes with the following items to help you locate the resource, where the event has been intercepted: | ||
|
|
||
| * Searchbox | ||
| * Cluster filter | ||
| * Namespace filter | ||
| * Action filter (event type, i.e., `Created`, `Updated`, `Deleted`) | ||
| * Watcher filter (to check the intercepted changes of a specific watcher) | ||
|
|
||
| You get the following details in the results shown on the page. | ||
|
|
||
| |Field | Description | | ||
| |-------|-------------| | ||
| |Change In Resource|Describes the type of change to the Kubernetes resource along with a link to its manifest| | ||
| |Cluster/Namespace |Shows the cluster and namespace where the tracked Kubernetes resource belongs to| | ||
| |Intercepted By |Shows the name of the watcher that intercepted the change| | ||
| |Intercepted At |Shows the date and time when the event occurred | | ||
| |Job Execution |Shows the status of the execution of job, e.g., `In Progress`, `Succeeded`, `Failed`| | ||
| |Logs |Links to the job log, i.e, the `Run history` page of the job| | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.