DEV Community

loading...

[AWS EKS] Setup CloudWatch Metrics

panupongdeve profile image PanupongDev ・1 min read

step1 - add policy to your nodegroup(s)

click
Alt Text

click
Alt Text

CloudWatchAgentServerPolicy -> attach policy

Alt Text

step2 - deploy the cloudwatch agent



curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/master/k8s-yaml-templates/quickstart/cwagent-fluentd-quickstart.yaml | sed "s/{{cluster_name}}/(( cluster name ))/;s/{{region_name}}/((region_name))/" | kubectl apply -f -

Alt Text

testing - cloudwatch metrics

kubectl run php-apache --image=k8s.gcr.io/hpa-example --requests=cpu=200m --limits=cpu=500m --expose --port=80

kubectl run --generator=run-pod/v1 -it --rm load-generator --image=busybox /bin/sh


while true; do wget -q -O- http://php-apache.default.svc.cluster.local; done

Discussion (0)

pic
Editor guide