aws-samples / amazon-cloudwatch-container-insights

CloudWatch Agent Dockerfile and K8s YAML templates for CloudWatch Container Insights.
MIT No Attribution
165 stars 108 forks source link

add enhanced container insights sample #144

Closed chadpatel closed 1 year ago

chadpatel commented 1 year ago

Issue

Enhanced container insights has slightly different RBAC and config settings, we need a new sample for sharing with GA customers

Description of changes:

     resources: ["pods", "nodes", "endpoints"]
     verbs: ["list", "watch"]
   - apiGroups: ["apps"]
-    resources: ["replicasets"]
+    resources: ["replicasets", "daemonsets", "deployments"]
     verbs: ["list", "watch"]
   - apiGroups: ["batch"]
     resources: ["jobs"]
@@ -30,6 +30,8 @@ rules:
     resources: ["configmaps"]
     resourceNames: ["cwagent-clusterleader"]
     verbs: ["get","update"]
+  - nonResourceURLs: ["/metrics"]
+    verbs: ["get", "list", "watch"]

I also added metric_granularity.

I kept the image as-is as everything for enhanced will need to be in the GA ECR repo, for beta customers we could provide the beta ECR image link

I also increased the memory limit to 400

          resources:
            limits:
              cpu:  200m
              memory: 400Mi

I did not increase the memory "request", it is probably fine either way. Memory request is primarily used for pod scheduling, since

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.