Step 1: Attaching the CloudWatchAgentServerPolicy to the IAM Role
The CloudWatch agent needs permissions to collect and send metrics, including memory metrics, to Amazon CloudWatch. You can attach the CloudWatchAgentServerPolicy managed IAM policy to the IAM instance profile or service account role to grant these permissions.
Action: Attach the CloudWatchAgentServerPolicy managed IAM policy to the IAM instance profile that the EKS cluster uses.
Why: This ensures the CloudWatch agent has the necessary permissions to collect memory metrics.
[Reference: AWS documentation on CloudWatch Agent Permissions., This corresponds to Option A: Attach the CloudWatchAgentServerPolicy managed IAM policy to the IAM instance profile that the cluster uses., Step 2: Deploying the CloudWatch Agent to EC2 InstancesTo collect memory metrics from the EC2 instances running in the EKS cluster, the CloudWatch agent needs to be deployed on these instances. The agent collects system-level metrics, including memory usage., Action: Deploy the unified Amazon CloudWatch agent to the existing EC2 instances in the EKS cluster. Update the Amazon Machine Image (AMI) for future instances to include the CloudWatch agent., Why: The CloudWatch agent allows you to collect detailed memory metrics from the EC2 instances, which is not enabled by default., Reference: AWS documentation on Installing and Configuring the CloudWatch Agent., This corresponds to Option C: Collect performance metrics by deploying the unified Amazon CloudWatch agent to the existing EC2 instances in the cluster. Add the agent to the AMI for any new EC2 instances that are added to the cluster., Step 3: Analyzing Memory Metrics Using Container InsightsAfter collecting the memory metrics, you can analyze them using the pod_memory_utilization metric in Amazon CloudWatch Container Insights. This metric provides visibility into the memory usage of the containers (pods) in the EKS cluster., Action: Analyze the pod_memory_utilization CloudWatch metric in the Container Insights namespace by using the Service dimension., Why: This provides detailed insights into memory usage at the container level, which helps diagnose memory-related issues., Reference: AWS documentation on CloudWatch Container Insights., This corresponds to Option E: Analyze the pod_memory_utilization Amazon CloudWatch metric in the Container Insights namespace by using the Service dimension., , , ]
Submit