

# Container Insights の CloudWatch エージェントと Fluent Bit の削除
<a name="ContainerInsights-delete-agent"></a>

Amazon EKS 向けの CloudWatch Observability アドオンのインストールを使用して Container Insights をインストールした場合、次のコマンドを入力して Container Insights と CloudWatch エージェントを削除できます。

**注記**  
Amazon EKS アドオンは Windows ワーカーノードで Container Insights をサポートするようになりました。Amazon EKS アドオンを削除すると、Windows 用の Container Insights も削除されます。

```
aws eks delete-addon —cluster-name my-cluster —addon-name amazon-cloudwatch-observability
```

そうでない場合、CloudWatch エージェントおよび Fluent Bit に関連するすべてのリソースを削除するには、次のコマンドを入力します。このコマンドで、*My\$1Cluster\$1Name* はお使いの Amazon EKS または Kubernetes クラスターの名前、*My\$1Region* はログが発行されるリージョンの名前です。

```
ClusterName=My_Cluster_Name
RegionName=My-Region
curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/main/k8s-quickstart/cwagent-operator-rendered.yaml | sed 's/{{cluster_name}}/'${ClusterName}'/g;s/{{region_name}}/'${RegionName}'/g' | kubectl delete -f -
curl https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/main/k8s-quickstart/cwagent-custom-resource-definitions.yaml | kubectl delete -f -
```