기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
Amazon EKS 및 Kubernetes에서 Container Insights의 빠른 시작 설정
Container Insights 설정을 완료하려면 이 단원의 빠른 시작 지침을 따르세요.
중요
이 단원의 단계를 완료하기 전에 먼저, IAM 권한을 포함한 사전 조건을 확인해야 합니다. 자세한 정보는 사전 조건 확인을 참조하세요.
또는 클러스터 지표를 수집하도록 CloudWatch 에이전트 설정 및 Logs에 CloudWatch 로그 전송 단원의 지침을 따를 수 있습니다. 이러한 단원에서는 CloudWatch 에이전트가 Amazon EKS 및 Kubernetes와 작동하는 방식에 대한 추가 구성 세부 정보를 제공하지만, 추가 설치 단계를 수행해야 합니다.
참고
Amazon은 이제 Container Insights의 기본 로그 솔루션으로 상당한 성능 향상을 제공하는 Fluent Bit를 출시했습니다. 따라서 Fluentd 대신 Fluent Bit를 사용하는 것이 좋습니다.
CloudWatch 에이전트 및 Fluent Bit를 사용한 빠른 시작
Fluent Bit에는 두 가지 구성, 즉 최적화된 버전 및 Fluentd와 더 유사한 환경을 제공하는 버전이 있습니다. 빠른 시작 구성은 최적화된 버전을 사용합니다. FluentD 호환 구성에 대한 자세한 내용은 단원을 참조하십시오Fluent DaemonSet Bit를 A로 설정하여 Logs에 CloudWatch 로그 전송.
빠른 시작을 사용해 Container Insights를 배포하려면 다음 명령을 입력하세요.
참고
다음 설정 단계는 기본적으로 익명 사용자로 Docker Hub에서 컨테이너 이미지를 가져옵니다. 이 가져오기에는 속도 제한이 적용될 수 있습니다. 자세한 정보는 CloudWatch 에이전트 컨테이너 이미지을 참조하세요.
ClusterName=<my-cluster-name> RegionName=<my-cluster-region> FluentBitHttpPort='2020' FluentBitReadFromHead='Off' [[ ${FluentBitReadFromHead} = 'On' ]] && FluentBitReadFromTail='Off'|| FluentBitReadFromTail='On' [[ -z ${FluentBitHttpPort} ]] && FluentBitHttpServer='Off' || FluentBitHttpServer='On' curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluent-bit-quickstart.yaml | sed 's/{{cluster_name}}/'${ClusterName}'/;s/{{region_name}}/'${RegionName}'/;s/{{http_server_toggle}}/"'${FluentBitHttpServer}'"/;s/{{http_server_port}}/"'${FluentBitHttpPort}'"/;s/{{read_from_head}}/"'${FluentBitReadFromHead}'"/;s/{{read_from_tail}}/"'${FluentBitReadFromTail}'"/' | kubectl apply -f -
이 명령에서 my-cluster-name
은 Amazon EKS 또는 Kubernetes 클러스터의 my-cluster-region
이름이며, 은 로그가 게시되는 리전의 이름입니다. AWS 아웃바운드 데이터 전송 비용을 줄이기 위해 클러스터가 배포되는 리전과 동일한 리전을 사용하는 것이 좋습니다.
예를 들어 MyCluster
라는 클러스터에서 Container Insights를 배포하고 로그 및 지표를 미국 서부(오레곤)에 게시하려면 다음 명령을 입력합니다.
ClusterName='MyCluster' LogRegion='us-west-2' FluentBitHttpPort='2020' FluentBitReadFromHead='Off' [[ ${FluentBitReadFromHead} = 'On' ]] && FluentBitReadFromTail='Off'|| FluentBitReadFromTail='On' [[ -z ${FluentBitHttpPort} ]] && FluentBitHttpServer='Off' || FluentBitHttpServer='On' curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluent-bit-quickstart.yaml | sed 's/{{cluster_name}}/'${ClusterName}'/;s/{{region_name}}/'${LogRegion}'/;s/{{http_server_toggle}}/"'${FluentBitHttpServer}'"/;s/{{http_server_port}}/"'${FluentBitHttpPort}'"/;s/{{read_from_head}}/"'${FluentBitReadFromHead}'"/;s/{{read_from_tail}}/"'${FluentBitReadFromTail}'"/' | kubectl apply -f -
Fluentd에서 마이그레이션
Fluentd를 이미 구성했는데 Fluent Bit로 이동하려는 경우 Fluent Bit를 설치한 후 Fluentd 포드를 삭제해야 합니다. 다음 명령을 사용하여 Fluentd를 삭제할 수 있습니다.
curl 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 delete -f - kubectl delete configmap cluster-info -n amazon-cloudwatch
Container Insights 삭제
빠른 시작 설정을 사용한 후 Container Insights를 제거하려면 다음 명령을 입력하세요.
curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/quickstart/cwagent-fluent-bit-quickstart.yaml | sed 's/{{cluster_name}}/'${ClusterName}'/;s/{{region_name}}/'${LogRegion}'/;s/{{http_server_toggle}}/"'${FluentBitHttpServer}'"/;s/{{http_server_port}}/"'${FluentBitHttpPort}'"/;s/{{read_from_head}}/"'${FluentBitReadFromHead}'"/;s/{{read_from_tail}}/"'${FluentBitReadFromTail}'"/' | kubectl delete -f -
CloudWatch 에이전트 및 Fluentd를 사용한 빠른 시작
Kubernetes 클러스터에서 이미 Fluentd를 사용하고 있고 이를 Container Insights의 로그 솔루션으로 확장하려는 경우 이를 위해 FluentD 구성을 제공합니다.
주의
Fluentd에 대한 Container Insights 지원은 현재 유지 관리 모드에 있습니다. 즉AWS, 는 Fluentd에 대한 추가 업데이트를 제공하지 않으며 가까운 시일 내에 Fluentd를 사용 중지할 future. 또한 Container Insights의 현재 FluentD 구성은 최신 개선 사항 및 보안 패치가 없는 이전 버전의 FluentD 이미지를fluent/fluentd-kubernetes-daemonset:v1.7.3-debian-cloudwatch-1.0
사용하고 있습니다. 오픈 소스 커뮤니티에서 지원하는 최신 Fluentd 이미지는 단원을 참조하세요 fluentd-kubernetes-daemonset
가능하면 Container FluentBit Insights와 함께 사용하도록 마이그레이션하는 것이 좋습니다. Container Insights의 로그 FluentBit 전달자로 사용하면 상당한 성능 향상을 얻을 수 있습니다.
자세한 내용은 Fluent DaemonSet Bit를 A로 설정하여 Logs에 CloudWatch 로그 전송 및 이미 Fluentd를 사용 중인 경우 차이점 단원을 참조하세요.
빠른 시작을 사용하여 CloudWatch 에이전트 및 Fluentd를 배포하려면 다음 명령을 사용합니다. 다음 설정에는 커뮤니티 지원 Fluentd 컨테이너 이미지가 포함되어 있습니다. 이미지를 Fluentd 이미지 요구 사항을 충족하는 자체 Fluentd 이미지로 바꿀 수 있습니다. 자세한 정보는 (선택 사항) Fluentd를 DaemonSet Logs에 전송하도록 CloudWatch 설정을 참조하세요.
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}}/cluster-region
/" | kubectl apply -f -
이 명령에서 cluster-name
은 Amazon EKS 또는 Kubernetes 클러스터의 이름이며, cluster-region
은 로그가 게시되는 리전의 이름입니다. AWS 아웃바운드 데이터 전송 비용을 줄이기 위해 클러스터가 배포되는 리전과 동일한 리전을 사용하는 것이 좋습니다.
예를 들어 MyCluster
라는 클러스터에서 Container Insights를 배포하고 로그 및 지표를 미국 서부(오레곤)에 게시하려면 다음 명령을 입력합니다.
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}}/MyCluster/;s/{{region_name}}/us-west-2/" | kubectl apply -f -
Container Insights 삭제
빠른 시작 설정을 사용한 후 Container Insights를 제거하려면 다음 명령을 입력하세요.
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}}/cluster-region
/" | kubectl delete -f -