- 태스크 9: Amazon CloudWatch Container Insights 배포2024년 05월 08일
- 59lee
- 작성자
- 2024.05.08.:43
CloudWatch Container Insights 실습 가이드 CloudWatch Container Insights 실습 가이드
목차
소개
CloudWatch Container Insights는 컨테이너화된 애플리케이션과 마이크로서비스의 지표와 로그를 수집하고 집계하며 요약합니다. Amazon ECS, EKS, EC2의 Kubernetes 환경에서 사용할 수 있습니다.
사전 준비
먼저 Amazon EKS 컴퓨팅 노드의 IAM 역할에
CloudWatchAgentServerPolicy
를 추가해야 합니다.export instanceId=$(aws ec2 describe-instances \ --filters Name=instance-type,Values=t3.medium \ --query "Reservations[0].Instances[*].InstanceId" \ --output text) export instanceProfileArn=$(aws ec2 describe-instances \ --instance-ids $instanceId \ --query 'Reservations[*].Instances[*].IamInstanceProfile.Arn' \ --output text) export instanceProfileName=$(echo $instanceProfileArn | awk -F/ '{print $NF}') export roleName=$(aws iam get-instance-profile \ --instance-profile-name $instanceProfileName \ --query "InstanceProfile.Roles[*].RoleName" \ --output text) sudo chmod +x ~/environment/eksLabRepo/containerInsights.sh ~/environment/eksLabRepo/./containerInsights.sh
CloudWatch Container Insights 배포
export CLUSTER_NAME=$(aws eks describe-cluster \ --name eks-lab-cluster \ --query 'cluster.name' \ --output text) curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluentd-quickstart.yaml \ | sed "s/{{cluster_name}}/$CLUSTER_NAME/;s/{{region_name}}/$AWS_DEFAULT_REGION/" \ | kubectl apply -f -
예상 출력:
namespace/amazon-cloudwatch created ... daemonset.apps/fluentd-cloudwatch created
완료까지 약 8~10분 소요될 수 있습니다.
콘솔에서 확인
- Console에서 CloudWatch > Insights > Container Insights 접근
- Map view 선택 후 클러스터 및 네임스페이스 확인
IAM 오류 메시지는 무시하고 진행 가능합니다.
결론
이제 다음 태스크를 수행할 수 있어야 합니다:
- Cloud9 환경 설정
- EKS 클러스터 생성
- Docker 이미지 ECR로 푸시
- Load Balancer Controller 배포
- CloudWatch Insights 구성 및 확인
실습 종료
- Console에서 AWSLabsUser 선택 후 Sign out
- 실습 종료 버튼 클릭
추가 리소스
자세한 교육은 AWS Training을 참고하십시오.
다음글이전글이전 글이 없습니다.댓글
스킨 업데이트 안내
현재 이용하고 계신 스킨의 버전보다 더 높은 최신 버전이 감지 되었습니다. 최신버전 스킨 파일을 다운로드 받을 수 있는 페이지로 이동하시겠습니까?
("아니오" 를 선택할 시 30일 동안 최신 버전이 감지되어도 모달 창이 표시되지 않습니다.)