aws-samples / amazon-cloudwatch-container-insights

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

Installed Fluent Bit using fluent-bit-compatible.yaml, container logs are not parsed correctly when container runtime is containerd #139

Open hiraken-w opened 1 year ago

hiraken-w commented 1 year ago

The following AWS documentation guides us on how to install using fluent-bit-compatible.yaml.

Set up Fluent Bit as a DaemonSet to send logs to CloudWatch Logs - Amazon CloudWatch

  1. Download and deploy the Fluent Bit daemonset to the cluster by running one of the following commands. (snip) ・If you want the Fluent Bit configuration that is more similar to Fluentd, run this command. kubectl apply -f https://raw.githubusercontent.com/aws-samples/amazon-cloudwatch-container-insights/latest/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/fluent-bit/fluent-bit-compatible.yaml

However, currently only docker is specified in the fluent-bit-compatible.yaml parser, and cri is not specified.

https://github.com/aws-samples/amazon-cloudwatch-container-insights/blob/5215e6d9cfe4a4922ceb691ea7e03d5dc3b40712/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/fluent-bit/fluent-bit-compatible.yaml#L99

I think it needs to be fixed in the same way fluent-bit.yaml

https://github.com/aws-samples/amazon-cloudwatch-container-insights/blob/5215e6d9cfe4a4922ceb691ea7e03d5dc3b40712/k8s-deployment-manifest-templates/deployment-mode/daemonset/container-insights-monitoring/fluent-bit/fluent-bit.yaml#L71