apiVersion: v1 kind: Namespace metadata: name: amazon-cloudwatch labels: name: amazon-cloudwatch --- apiVersion: v1 data: cwagentconfig.json: | { "csm": { "service_addresses": ["udp4://0.0.0.0:31000", "udp6://[::]:31000"], "memory_limit_in_mb": 20 } } kind: ConfigMap metadata: name: daemonset-config namespace: amazon-cloudwatch --- apiVersion: apps/v1 kind: DaemonSet metadata: namespace: amazon-cloudwatch name: cloudwatch-agent spec: selector: matchLabels: name: cloudwatch-agent template: metadata: labels: name: cloudwatch-agent spec: containers: - name: cloudwatch-agent image: public.ecr.aws/cloudwatch-agent/cloudwatch-agent:latest imagePullPolicy: Always ports: - containerPort: 31000 hostPort: 31000 protocol: UDP resources: limits: cpu: 200m memory: 100Mi requests: cpu: 200m memory: 100Mi volumeMounts: - name: cwagentconfig mountPath: /etc/cwagentconfig volumes: - name: cwagentconfig configMap: name: daemonset-config terminationGracePeriodSeconds: 10