How to setup Container Insights for AWS EKS with both EC2 Nodegroup and Fargate Profile?

0

I have an EKS cluster with both EC2 Nodegroup and Fargate Profile, and I want to setup Container Insights for both. I followed the docs, but I got error which tell that the default-scheduler failed to schedule fluent-bit on Fargate Profile. As I understand, it should be Fargate Scheduler launch fluent-bit as sidecar container into Fargate Pods.

Does anyone knows how to setup Container Insights for both EC2 Nodegroup and Fargate Profile? Thank you

hai
質問済み 1年前416ビュー
1回答
0

To setup Container Insights for both EC2 Nodegroup and Fargate Profile in your EKS cluster, you need to follow these steps:

  1. Enable Container Insights for your cluster by following the steps mentioned in the official AWS documentation: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-EKS-quickstart.html
  2. Once you have enabled Container Insights, install the Fluent Bit log collector on your EC2 instances by running the following command:
kubectl apply -f https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-yaml-templates/quickstart/cwagent-fluent-bit-quickstart.yaml
  1. Verify that the Fluent Bit log collector is running by checking the logs of the fluent-bit container in the amazon-cloudwatch namespace:
kubectl -n amazon-cloudwatch logs -f fluent-bit-xxxxx
  1. To enable Container Insights for Fargate profiles, you need to create a Fargate profile with the cwagent and cwlogs addons enabled. You can do this by creating a YAML file with the following contents:
apiVersion: eksctl.io/v1alpha5
kind: FargateProfile
metadata:
  name: my-fargate-profile
  region: <region>
  version: '1.17'
spec:
  selectors:
    - namespace: default
  subnets:
    - subnet-xxxxxxxx
  addons:
    - name: cwagent
      version: 'latest'
    - name: cwlogs
      version: 'latest'
  1. Apply the YAML file using the eksctl CLI tool:
eksctl create fargateprofile -f fargate-profile.yaml
  1. Verify that the Fluent Bit log collector is running as a sidecar container in your Fargate pods by checking the logs of the fluent-bit container in the amazon-cloudwatch namespace:
kubectl -n amazon-cloudwatch logs -f fluent-bit-xxxxx

By following these steps, you should be able to enable Container Insights for both EC2 Nodegroup and Fargate Profile in your EKS cluster.

hash
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ