Skip to content

Using EKS on AWS Auto Mode - How Can I Monitor Pod and Node Memory Usage Like in CloudWatch?

0

I'm currently using Amazon EKS in Auto Mode, and I've noticed that my pods are frequently getting restarted due to OOMKill (Out Of Memory Kill). Unfortunately, I don't have access to the underlying EC2 instances, so I can't directly check node memory usage via CloudWatch or SSH into the instances.

The EKS Monitoring Portal provided doesn't offer detailed or helpful insights, especially not in a graphical way like CloudWatch does.

My questions:

Is there a native AWS service or feature that can help me monitor memory usage per pod and per node in EKS Auto Mode?

Any advice or guidance would be greatly appreciated.

Thanks!

asked a year ago814 views

1 Answer
0

You have several options to monitor memory usage for your EKS pods and nodes, even without direct access to the underlying EC2 instances.

The most comprehensive solution is to enable Container Insights, which is specifically designed for this purpose. Container Insights collects, aggregates, and summarizes metrics and logs from your containerized applications and microservices. Once enabled, you can view detailed metrics like pod_cpu_utilization and pod_memory_utilization directly in the CloudWatch console.

To enable Container Insights for your EKS cluster, you can use the AWS CLI:

aws eks update-cluster-config --name <cluster-name> --logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}'

For more immediate visibility, you can use kubectl commands:

  • kubectl top pods - Shows current CPU and memory usage for all pods
  • kubectl top nodes - Displays resource usage across your nodes
  • kubectl top pod <pod-name> --namespace <namespace> --containers - Provides container-level resource metrics
  • kubectl describe pod <pod> - Gives detailed information about a specific pod, including resource requests and limits

To analyze OOMKill events specifically, you can run queries in CloudWatch Logs Insights. For example, to check memory utilization:

stats avg(MemoryUtilized) by bin (30m) as period, TaskDefinitionFamily, TaskDefinitionRevision
| filter Type = "Task" | sort period desc, TaskDefinitionFamily | limit 10

You can also consider using the Kubernetes Dashboard, which provides a web-based UI with information about resource usage at cluster, node, and pod levels. This gives you consolidated visibility into your Kubernetes environment with resource usage breakdowns.

For a more complete monitoring solution, consider setting up CloudWatch alarms for key metrics like memory usage and configure notifications using Amazon SNS to alert you before pods experience OOMKill events.
Sources
How to monitor high resource usage in Amazon EKS tasks and services | AWS re:Post
Metrics for Amazon EKS and Kubernetes - AWS Prescriptive Guidance
Monitor high resource usage in ECS tasks and services | AWS re:Post
Expenditure awareness - Amazon EKS
Logging and monitoring on Amazon EKS - AWS Prescriptive Guidance

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.