-
Notifications
You must be signed in to change notification settings - Fork 116
Add resorucequota related monitoring alerts #1057
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -140,3 +140,55 @@ Harvester automatically manages this bottleneck through the following workflow: | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| To minimize reliance on automatic adjustments, manually update `ResourceQuota` settings whenever overhead configurations are changed. Ultimately, the VM's final memory footprint must always comply with defined namespace limits, regardless of whether it is migrated or cold-rebooted. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ::: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Monitoring ResourceQuota Usage and Alerts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Monitoring resource usage is critical to cluster stability, as high `ResourceQuota` consumption can cause VM startup failures or prevent successful VM migrations. Real-time visibility and proactive notifications ensure you can address capacity constraints before they impact your workloads. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| When the [rancher-monitoring](../advanced/addons.md) addon is enabled, it creates the `PrometheusRule` resource `rancher-monitoring-kubernetes-resources` in `cattle-monitoring-system`. This includes the following pre-configured ResourceQuota alert rules. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Alert Rule Definitions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Alert Name | Condition | Duration | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | :--- | :--- | :--- | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | **KubeCPUQuotaOvercommit** | CPU usage > 150% | 5 minutes | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | **KubeMemoryQuotaOvercommit** | Memory usage > 150% | 5 minutes | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | **KubeQuotaAlmostFull** | CPU/Memory usage between 90% and 100% | 15 minutes | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | **KubeQuotaFullyUsed** | CPU/Memory usage = 100% | 15 minutes | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | **KubeQuotaExceeded** | CPU/Memory usage > 100% | 15 minutes | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+150
to
+158
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Verifying ResourceQuota Status | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| To inspect your current resource usage, use the `kubectl get resourcequota -A` command. This helps correlate your manual observations with the alert triggers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **Example Output:** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For a `ResourceQuota` named `default-kflsw` in the `quota-test` namespace: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```sh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NAMESPACE NAME REQUEST LIMIT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| quota-test default-kflsw limits.cpu: 2015m/3, limits.memory: 4797464313/5000Mi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
w13915984028 marked this conversation as resolved.
w13915984028 marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| In this instance, the memory usage 4797464313(4575Mi) is approximately 91.5% of the 5000Mi limit, which triggers the **KubeQuotaAlmostFull** alert once the 15-minute duration threshold is surpassed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+162
to
+174
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Observing Alerts in Harvester | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Once threshold conditions are met and the duration has elapsed, alerts transition to the "Firing" state. Use the following steps to navigate to your monitoring dashboard: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1. **Access Addons:** Go to the **Advanced** section of the Harvester dashboard and select **Addons**. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2. **Open Monitoring:** Click on the **rancher-monitoring** addon. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3. **Launch Prometheus:** Switch to the **Prometheus** tab and click the **Prometheus Graph** link. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4. **Filter Alerts:** Within the Prometheus interface, click the **Alerts** tab. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5. **Locate Rules:** Search for `kubernetes-resources` to view the status of your ResourceQuota alerts. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+176
to
+184
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| *Figure: Alert status for the `ResourceQuota` `default-kflsw`.* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| To integrate external notifications, refer to [Configure AlertmanagerConfig](../monitoring/harvester-monitoring.md#configure-alertmanagerconfig-from-webui) to forward alerts to a central monitoring or notification server. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For more information on managing alerts, see [View and Manage Alerts](../monitoring/harvester-monitoring.md#view-and-manage-alerts). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For troubleshooting guidance, refer to the [Prometheus Operator Runbooks](https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubequotaalmostfull/). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+186
to
+194
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.