aws-samples / amazon-cloudwatch-container-insights

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

cloudwatch-agent CPU request too high, unable to patch #171

Open cyounkins opened 5 months ago

cyounkins commented 5 months ago

I have v1.7.0-eksbuild.1 of the amazon-cloudwatch-observability add-on installed. Kubernetes 1.27.

kubectl get daemonset cloudwatch-agent -n amazon-cloudwatch -o yaml | grep -A6 'resources:'
        resources:
          limits:
            cpu: 500m
            memory: 512Mi
          requests:
            cpu: 250m
            memory: 128Mi

This is too high for our use on a small cluster with 2 vCPU nodes. I would like to reduce it.

kubectl patch daemonset cloudwatch-agent -n amazon-cloudwatch --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/resources/requests/cpu", "value": "50m"}]'

But it is immediately reverted. I also tried pulling down the yaml, editing, and applying to have the same result. Is there something in the background monitoring that config to confirm compliance with the add-on? Is there any strategy I can use to reduce the CPU request?