brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Dec 18. 2023

EKS 10탄-2. EKS 로깅-2023-12

2/4

옵저버빌리티(Observability) =  관찰 가능성

로그,메트릭,트레이스 3가지 관찰하는 것이다.



<1> EKS로깅이 옵저버 빌리티텝으로 변경되었다.

<2> Pod 로깅은 Fluentbit으로 Cloudwatch Logs에서 확인한다.

<3> 다음 = EKS 옵저버빌리티




<1> EKS로깅이 옵저버 빌리티텝으로 변경되었다.


옵저버 빌리티에서 보자


1


2

제어 플레인 로깅은 디폴트로 비활성화 이다.

콘솔로 활성화 가능하다.

CLI로 활성화 가능하다.



3

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



4

업데이트 여부는 업데이트 기록을 보면 알수 있다.

2분전 업데이트 ~~




5

새로 고침하면 활성화 된것이 보인다.



6

콘솔로 다시 오프 가능

제어 플레인 로깅을 볼일은 많지 않다.

업그레이드시나 해킹시 등 보지 않을까한다.





7

로그 내용은 Cloudwatch > 로그 그룹에 가면 보인다.


/aws/eks/myeks/cluster




8

로그 이벤트 검색은 Cloudwatch los insight에서 확인하자 




아무래도 APIserver 호출이 많죠.

이쪽으로 누가 호출했는지 확인~


fields userAgent, requestURI, @timestamp, @message

| filter @logStream ~= "kube-apiserver-audit"

| stats count(userAgent) as count by userAgent

| sort count desc





<2> Pod 로깅은 Fluentbit으로 Cloudwatch Logs에서 확인한다.


1


https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs.html



step1 : Create a namespace for CloudWatch


kubectl apply -f https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/cloudwatch-namespace.yaml



step2 : install fluntd


kubectl create configmap cluster-info \

--from-literal=cluster.name=cluster_name \

--from-literal=logs.region=region_name -n amazon-cloudwatch


kubectl apply -f https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/fluentd/fluentd.yaml



kubectl get pods -n amazon-cloudwatch




Step 3: Verify the Fluentd setup


Open the CloudWatch console at https://console.aws.amazon.com/cloudwatch/.







<3> 다음 = EKS 옵저버빌리티



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



감사합니다.

매거진의 이전글 EKS 10탄-1. EKS 설치-2023-12월

작품 선택

키워드 선택 0 / 3 0

댓글여부

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