Container Insights のインストール

以下のコマンドを実行し、Container Insights をインストールします。 詳細な情報はこちらから確認できます

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.
  • DaemonSet の各種リソース:
    • SecurityAccount
    • ClusterRole
    • ClusterRoleBinding
    • ConfigMap
  • DaemonSet として Cloudwatch-Agent (メトリクス送信用).
  • DaemonSet として fluentd (ログ送信用).

以下のコマンドで、 DaemonSets がデプロイされたことを確認します

kubectl -n amazon-cloudwatch get daemonsets

Output


NAME                 DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
cloudwatch-agent     3         3         3       3            3           <none>          2m43s
fluentd-cloudwatch   3         3         3       3            3           <none>          2m43s

これで、メトリクスやログが CloudWatch に送られています