brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Jul 09. 2021

EKS 2탄-5. AWS EKS- 에이전트  설치

실습 2탄 = 5/11

<1>  EKS 클러스터 서버에  cloudwatch 에이전트  설치.




<1>  EKS 클러스터 서버에  cloudwatch 에이전트  설치.


cwagent-fluentd 설치


1

EKS 클러스터 서버에  cloudwatch 에이전트  설치한다.



역할 확인

test -n "$ROLE_NAME" && echo ROLE_NAME is "$ROLE_NAME" || echo ROLE_NAME is not set

ROLE_NAME is eksctl-eksworkshop-eksctl-nodegro-NodeInstanceRole-11G0xxx



2

role에 정책 연결?

aws iam attach-role-policy  --role-name $ROLE_NAME  --policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy



3

정책 연결 확인?

aws iam list-attached-role-policies --role-name $ROLE_NAME | grep CloudWatchAgentServerPolicy || echo 'Policy not found'

            "PolicyName": "CloudWatchAgentServerPolicy",

            "PolicyArn": "arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy"



4

cloudwatch insight 설치?


curl -s 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}}/eksworkshop-eksctl/;s/{{region_name}}/${AWS_REGION}/" | kubectl apply -f -


namespace/amazon-cloudwatch created

serviceaccount/cloudwatch-agent created

clusterrole.rbac.authorization.k8s.io/cloudwatch-agent-role created

clusterrolebinding.rbac.authorization.k8s.io/cloudwatch-agent-role-binding created

configmap/cwagentconfig created

daemonset.apps/cloudwatch-agent created

configmap/cluster-info created

serviceaccount/fluentd created

clusterrole.rbac.authorization.k8s.io/fluentd-role created

clusterrolebinding.rbac.authorization.k8s.io/fluentd-role-binding created

configmap/fluentd-config created

daemonset.apps/fluentd-cloudwatch created




5

데몬셋 배포 확인?

kubectl -n amazon-cloudwatch get daemonsets

NAME                 DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE

cloudwatch-agent     3         3         3       3            3           <none>          34s

fluentd-cloudwatch   3         3         3       3            3           <none>          34s



6

콘솔 접속

Cloudwatch > Container Insights > Resources >  EKS Cluster






https://console.aws.amazon.com/cloudwatch/home?region=us-west-2#cw:dashboard=Container;context=~(clusters~'eksworkshop-eksctl~dimensions~(~)~performanceType~'Service)



7

AWS 워크셥으로 공부하기~


 Container Insights  work shop

https://www.eksworkshop.com/intermediate/250_cloudwatch_container_insights/



다음과정


https://brunch.co.kr/@topasvga/1697




<10>   AWS EKS 실습 2탄



https://brunch.co.kr/@topasvga/1882



https://brunch.co.kr/@topasvga/1679


감사합니다.






매거진의 이전글 EKS 2탄-4. AWS EKS- 워드 프레스 설치

작품 선택

키워드 선택 0 / 3 0

댓글여부

afliean
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari