summaryrefslogtreecommitdiffstats
path: root/health/guides/cgroups/k8s_cgroup_ram_in_use.md
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--health/guides/cgroups/k8s_cgroup_ram_in_use.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/health/guides/cgroups/k8s_cgroup_ram_in_use.md b/health/guides/cgroups/k8s_cgroup_ram_in_use.md
new file mode 100644
index 00000000..aec443b7
--- /dev/null
+++ b/health/guides/cgroups/k8s_cgroup_ram_in_use.md
@@ -0,0 +1,42 @@
+### Understand the alert
+
+This alert monitors the `RAM usage` in a Kubernetes cluster by calculating the ratio of the memory used by a cgroup to its memory limit. If the memory usage exceeds certain thresholds, the alert triggers and indicates that the system's memory resources are under pressure.
+
+### Troubleshoot the alert
+
+1. Check overall RAM usage in the cluster
+
+ Use the `kubectl top nodes` command to check the overall memory usage on the cluster nodes:
+ ```
+ kubectl top nodes
+ ```
+
+2. Identify Pods with high memory usage
+
+ Use the `kubectl top pods --all-namespaces` command to identify Pods consuming a high amount of memory:
+ ```
+ kubectl top pods --all-namespaces
+ ```
+
+3. Inspect logs for errors or misconfigurations
+
+ Check the logs of Pods consuming high memory for any issues or misconfigurations:
+ ```
+ kubectl logs -n <namespace> <pod_name>
+ ```
+
+4. Inspect container resource limits
+
+ Review the resource limits defined in the Pod's yaml file, particularly the `limits` and `requests` sections. If you're not setting limits on Pods, then consider setting appropriate limits to prevent running out of resources.
+
+5. Scale or optimize applications
+
+ If high memory usage is expected and justified, consider scaling the application by adding replicas or increasing the allocated resources.
+
+ If the memory usage is not justified, optimizing the application code or configurations may help reduce memory usage.
+
+### Useful resources
+
+1. [Kubernetes best practices: Organizing with Namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/)
+2. [Managing Resources for Containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)
+3. [Configure Default Memory Requests and Limits](https://kubernetes.io/docs/tasks/administer-cluster/memory-default-namespace/) \ No newline at end of file