aws-observability / helm-charts

The AWS Observability Helm Charts repository contains Helm charts to provide easy mechanisms to setup the CloudWatch Agent and other collection agents to collect telemetry data such as metrics, logs and traces to send to AWS monitoring services.
Apache License 2.0
8 stars 14 forks source link

Create separate agent daemonsets on windows for container insights and application signals #90

Closed lisguo closed 1 week ago

lisguo commented 2 weeks ago

Issue #, if available: N/A

Description of changes: Currently, kubernetes networking is not supported on windows containers with host networking:

The following networking functionality is not supported on Windows nodes:

    Host networking mode

From https://kubernetes.io/docs/concepts/services-networking/windows-networking/

We need host networking to have the agent run as a host process container to retrieve container insights metrics from HCS (Host Compute Service).

In order to allow container insights and application signals, we need 2 daemonsets for windows. One running as a host process container, and another that is not.

This PR introduces a a new daemonset specifically for container insights cloudwatch-agent-windows-container-insights, and the current cloudwatch-agent-windows will be used for application signals.

This PR also addressing missing cluster name in the windows configs

Testing Ran helm template:

helm template amazon-cloudwatch-observability charts/amazon-cloudwatch-observability --set clusterName=test-dotnet --set region=us-east-1 --include-crds --namespace amazon-cloudwatch 

Pods:

NAMESPACE           NAME                                                              READY   STATUS                 RESTARTS       AGE
amazon-cloudwatch   amazon-cloudwatch-observability-controller-manager-65955f4bvddt   1/1     Running                0              4m14s
amazon-cloudwatch   cloudwatch-agent-t9wcr                                            1/1     Running                0              4m13s
amazon-cloudwatch   cloudwatch-agent-windows-container-insights-ffbdw                 1/1     Running                0              3m26s
amazon-cloudwatch   cloudwatch-agent-windows-rr8ls                                    1/1     Running                0              3m26s
amazon-cloudwatch   cloudwatch-agent-xddb2                                            1/1     Running                0              4m13s

services

kubectl get services -n amazon-cloudwatch
NAME                                                     TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
amazon-cloudwatch-observability-webhook-service          ClusterIP   10.100.223.138   <none>        443/TCP                      4m26s
cloudwatch-agent                                         ClusterIP   10.100.79.246    <none>        4315/TCP,4316/TCP,2000/TCP   4m24s
cloudwatch-agent-headless                                ClusterIP   None             <none>        4315/TCP,4316/TCP,2000/TCP   4m24s
cloudwatch-agent-monitoring                              ClusterIP   10.100.8.181     <none>        8888/TCP                     4m24s
cloudwatch-agent-windows                                 ClusterIP   10.100.157.47    <none>        4315/TCP,4316/TCP,2000/TCP   3m37s
cloudwatch-agent-windows-container-insights              ClusterIP   10.100.39.29     <none>        4315/TCP,4316/TCP,2000/TCP   3m37s
cloudwatch-agent-windows-container-insights-headless     ClusterIP   None             <none>        4315/TCP,4316/TCP,2000/TCP   3m37s
cloudwatch-agent-windows-container-insights-monitoring   ClusterIP   10.100.240.0     <none>        8888/TCP                     3m37s
cloudwatch-agent-windows-headless                        ClusterIP   None             <none>        4315/TCP,4316/TCP,2000/TCP   3m37s
cloudwatch-agent-windows-monitoring                      ClusterIP   10.100.105.192   <none>        8888/TCP                     3m37s
dcgm-exporter-service                                    ClusterIP   10.100.202.190   <none>        9400/TCP                     4m24s
neuron-monitor-service                                   ClusterIP   10.100.157.169   <none>        8000/TCP                     4m24s

AmazonCloudWatchAgent resources

kubectl describe amazoncloudwatchagent cloudwatch-agent-windows -n amazon-cloudwatch
Name:         cloudwatch-agent-windows
Namespace:    amazon-cloudwatch
Labels:       app.kubernetes.io/managed-by=amazon-cloudwatch-agent-operator
Annotations:  <none>
API Version:  cloudwatch.aws.amazon.com/v1alpha1
Kind:         AmazonCloudWatchAgent
Metadata:
  Creation Timestamp:  2024-08-29T21:02:58Z
  Generation:          2
  Resource Version:    6245391
  UID:                 de98c358-d07f-4326-a8d4-08192f334c7a
Spec:
  Config:  {"agent":{"region":"us-east-1"},"logs":{"metrics_collected":{"application_signals":{"hosted_in":"test-dotnet"}}},"traces":{"traces_collected":{"application_signals":{}}}}
kubectl describe amazoncloudwatchagent cloudwatch-agent-windows-container-insights -n amazon-cloudwatch
Name:         cloudwatch-agent-windows-container-insights
Namespace:    amazon-cloudwatch
Labels:       app.kubernetes.io/managed-by=amazon-cloudwatch-agent-operator
Annotations:  <none>
API Version:  cloudwatch.aws.amazon.com/v1alpha1
Kind:         AmazonCloudWatchAgent
Metadata:
  Creation Timestamp:  2024-08-29T21:20:20Z
  Generation:          1
  Resource Version:    6245408
  UID:                 7c1fa594-3517-4655-b593-9c8266a4040e
Spec:
  Config:  {"agent":{"region":"us-east-1"},"logs":{"metrics_collected":{"kubernetes":{"cluster_name":"test-dotnet","enhanced_container_insights":true}}}}

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