From 6fb673b3e0d3e652434aeed58edc0c71228e8b26 Mon Sep 17 00:00:00 2001 From: James Nguyen Date: Wed, 4 Aug 2021 02:40:01 +0800 Subject: [PATCH 1/3] Update fluentd-container-insight to support containerd logs --- charts/eks-container-insights/Chart.yaml | 4 ++-- .../eks-container-insights/templates/configmap.yaml | 12 ++++++------ .../eks-container-insights/templates/daemonset.yaml | 3 +++ charts/eks-container-insights/values.yaml | 9 ++++++++- dockerfiles/eks-container-insights/Dockerfile | 2 +- dockerfiles/fluentd/Dockerfile | 6 +++--- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/charts/eks-container-insights/Chart.yaml b/charts/eks-container-insights/Chart.yaml index 3845565..24d3b4d 100644 --- a/charts/eks-container-insights/Chart.yaml +++ b/charts/eks-container-insights/Chart.yaml @@ -1,6 +1,6 @@ -apiVersion: v1 +apiVersion: v2 appVersion: "1.0" description: A Helm chart for EKS Container Insights name: eks-container-insights -version: 0.4.1 +version: 0.4.2 home: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs.html diff --git a/charts/eks-container-insights/templates/configmap.yaml b/charts/eks-container-insights/templates/configmap.yaml index c62ae94..bf0d835 100644 --- a/charts/eks-container-insights/templates/configmap.yaml +++ b/charts/eks-container-insights/templates/configmap.yaml @@ -25,8 +25,8 @@ data: tag * read_from_head true - @type json - time_format %Y-%m-%dT%H:%M:%S.%NZ + @type "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TYPE'] || 'json'}" + time_format "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TIME_FORMAT'] || '%Y-%m-%dT%H:%M:%S.%NZ'}" @@ -39,8 +39,8 @@ data: tag * read_from_head true - @type json - time_format %Y-%m-%dT%H:%M:%S.%NZ + @type "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TYPE'] || 'json'}" + time_format "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TIME_FORMAT'] || '%Y-%m-%dT%H:%M:%S.%NZ'}" @@ -53,8 +53,8 @@ data: tag * read_from_head true - @type json - time_format %Y-%m-%dT%H:%M:%S.%NZ + @type "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TYPE'] || 'json'}" + time_format "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TIME_FORMAT'] || '%Y-%m-%dT%H:%M:%S.%NZ'}" diff --git a/charts/eks-container-insights/templates/daemonset.yaml b/charts/eks-container-insights/templates/daemonset.yaml index 784dac1..0284901 100644 --- a/charts/eks-container-insights/templates/daemonset.yaml +++ b/charts/eks-container-insights/templates/daemonset.yaml @@ -71,6 +71,9 @@ spec: value: regional # END Archive cluster logs to S3 {{- end }} + {{- with .Values.env }} + {{- toYaml . | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: diff --git a/charts/eks-container-insights/values.yaml b/charts/eks-container-insights/values.yaml index 7da8c65..5037e65 100644 --- a/charts/eks-container-insights/values.yaml +++ b/charts/eks-container-insights/values.yaml @@ -11,7 +11,7 @@ serviceAccount: annotations: {} image: basisai/eks-container-insights -imageTag: v1.12.4 +imageTag: v1.13.0 initImage: busybox initImageTag: 1.32.0 @@ -39,6 +39,13 @@ additional_container_logs_filters: [] additional_systemd_logs_filters: [] additional_host_logs_filters: [] +env: [] + # Use these variables if containerd runtime + # - name: FLUENT_CONTAINER_TAIL_PARSER_TYPE + # value: "cri" + # - name: FLUENT_CONTAINER_TAIL_PARSER_TIME_FORMAT + # value: "%Y-%m-%dT%H:%M:%S.%N%:z" + resources: limits: cpu: 200m diff --git a/dockerfiles/eks-container-insights/Dockerfile b/dockerfiles/eks-container-insights/Dockerfile index 9f7eff7..403f2ba 100644 --- a/dockerfiles/eks-container-insights/Dockerfile +++ b/dockerfiles/eks-container-insights/Dockerfile @@ -1,3 +1,3 @@ -FROM fluent/fluentd-kubernetes-daemonset:v1.12.4-debian-cloudwatch-amd64-1.3 +FROM fluent/fluentd-kubernetes-daemonset:v1.13-debian-cloudwatch-amd64-1 RUN gem install fluent-plugin-s3 -v 1.6.0 --no-document diff --git a/dockerfiles/fluentd/Dockerfile b/dockerfiles/fluentd/Dockerfile index 2d5d898..1c7a8bf 100644 --- a/dockerfiles/fluentd/Dockerfile +++ b/dockerfiles/fluentd/Dockerfile @@ -1,5 +1,5 @@ FROM quay.io/fluentd_elasticsearch/fluentd:v3.2.0 -RUN fluent-gem install digest-crc --version 0.5.1 \ - && fluent-gem install fluent-plugin-gcs --version 0.4.1 \ - && fluent-gem install fluent-plugin-s3 --version 1.6.0 +RUN fluent-gem install digest-crc --version 0.5.1 --no-document \ + && fluent-gem install fluent-plugin-gcs --version 0.4.1 --no-document \ + && fluent-gem install fluent-plugin-s3 --version 1.6.0 --no-document From b38b5517c2a8ff4be50900063768b52c845a958c Mon Sep 17 00:00:00 2001 From: James Nguyen Date: Wed, 4 Aug 2021 02:52:54 +0800 Subject: [PATCH 2/3] Add CODEOWNERS --- .github/CODEOWNERS | 4 ++++ tests/ct.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b416acc --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +# Order is important; the last matching pattern takes the most +# precedence. +# https://help.github.com/en/articles/about-code-owners +* @basisai/infrastructure diff --git a/tests/ct.yaml b/tests/ct.yaml index cb4a60d..0a34076 100644 --- a/tests/ct.yaml +++ b/tests/ct.yaml @@ -1,5 +1,5 @@ validate-maintainers: false chart-dirs: -- /charts + - /charts chart-repos: - jetstack=https://charts.jetstack.io From 2e7c1d8809be8ad4e210bf2d293df0d5bc0409bd Mon Sep 17 00:00:00 2001 From: "James (Anh-Tu) Nguyen" Date: Wed, 4 Aug 2021 11:22:28 +0800 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Yong Wen Chua --- charts/eks-container-insights/Chart.yaml | 2 +- dockerfiles/eks-container-insights/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/eks-container-insights/Chart.yaml b/charts/eks-container-insights/Chart.yaml index 24d3b4d..c6f0b01 100644 --- a/charts/eks-container-insights/Chart.yaml +++ b/charts/eks-container-insights/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 appVersion: "1.0" description: A Helm chart for EKS Container Insights name: eks-container-insights -version: 0.4.2 +version: 0.5.0 home: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Container-Insights-setup-logs.html diff --git a/dockerfiles/eks-container-insights/Dockerfile b/dockerfiles/eks-container-insights/Dockerfile index 403f2ba..73c2f8b 100644 --- a/dockerfiles/eks-container-insights/Dockerfile +++ b/dockerfiles/eks-container-insights/Dockerfile @@ -1,3 +1,3 @@ -FROM fluent/fluentd-kubernetes-daemonset:v1.13-debian-cloudwatch-amd64-1 +FROM fluent/fluentd-kubernetes-daemonset:v1.13.3-debian-cloudwatch-amd64-1.2 RUN gem install fluent-plugin-s3 -v 1.6.0 --no-document