From f29113f4da08d2d36e5ce2401eedbe94146da50f Mon Sep 17 00:00:00 2001 From: Rodrigue Koffi Date: Thu, 13 Jul 2023 18:58:14 +0200 Subject: [PATCH] Fluentbit improvements (#189) * Bump chart version * Take only log message * Add multiline parsing * Add variable config for refresh interval --- .../add-ons/aws-for-fluentbit/README.md | 1 + .../add-ons/aws-for-fluentbit/locals.tf | 3 ++- .../add-ons/aws-for-fluentbit/values.yaml | 16 +++++++++++++++- .../add-ons/aws-for-fluentbit/variables.tf | 7 +++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/modules/eks-monitoring/add-ons/aws-for-fluentbit/README.md b/modules/eks-monitoring/add-ons/aws-for-fluentbit/README.md index e3ef1a61..701d18b0 100644 --- a/modules/eks-monitoring/add-ons/aws-for-fluentbit/README.md +++ b/modules/eks-monitoring/add-ons/aws-for-fluentbit/README.md @@ -42,6 +42,7 @@ See this [Helm Chart](https://github.com/aws/eks-charts/tree/master/stable/aws-f | [helm\_config](#input\_helm\_config) | Helm provider config aws\_for\_fluent\_bit. | `any` | `{}` | no | | [irsa\_policies](#input\_irsa\_policies) | Additional IAM policies for a IAM role for service accounts | `list(string)` | `[]` | no | | [manage\_via\_gitops](#input\_manage\_via\_gitops) | Determines if the add-on should be managed via GitOps. | `bool` | `false` | no | +| [refresh\_interval](#input\_refresh\_interval) | FluentBit input refresh interval | `number` | `60` | no | ## Outputs diff --git a/modules/eks-monitoring/add-ons/aws-for-fluentbit/locals.tf b/modules/eks-monitoring/add-ons/aws-for-fluentbit/locals.tf index a53ce88c..e77d609e 100644 --- a/modules/eks-monitoring/add-ons/aws-for-fluentbit/locals.tf +++ b/modules/eks-monitoring/add-ons/aws-for-fluentbit/locals.tf @@ -18,7 +18,7 @@ locals { name = local.name chart = local.name repository = "https://aws.github.io/eks-charts" - version = "0.1.24" + version = "0.1.27" namespace = local.name values = local.default_helm_values description = "aws-for-fluentbit Helm Chart deployment configuration" @@ -33,6 +33,7 @@ locals { aws_region = var.addon_context.aws_region_name cluster_name = var.addon_context.eks_cluster_id log_retention_days = var.cw_log_retention_days + refresh_interval = var.refresh_interval service_account = local.service_account })] diff --git a/modules/eks-monitoring/add-ons/aws-for-fluentbit/values.yaml b/modules/eks-monitoring/add-ons/aws-for-fluentbit/values.yaml index 2900d7a1..be4afb9f 100644 --- a/modules/eks-monitoring/add-ons/aws-for-fluentbit/values.yaml +++ b/modules/eks-monitoring/add-ons/aws-for-fluentbit/values.yaml @@ -12,5 +12,19 @@ cloudWatchLogs: logGroupName: /aws/eks/observability-accelerator/workloads logGroupTemplate: /aws/eks/observability-accelerator/${cluster_name}/$kubernetes['namespace_name'] logStreamTemplate: $kubernetes['container_name'].$kubernetes['pod_name'] - log_key: log + logKey: log logRetentionDays: ${log_retention_days} + +input: + enabled: false + +additionalInputs: | + [INPUT] + Name tail + Tag kube.* + Path /var/log/containers/*.log + DB /var/log/flb_kube.db + Mem_Buf_Limit 5MB + Skip_Long_Lines On + Refresh_Interval ${refresh_interval} + multiline.parser cri, docker, go, java, python diff --git a/modules/eks-monitoring/add-ons/aws-for-fluentbit/variables.tf b/modules/eks-monitoring/add-ons/aws-for-fluentbit/variables.tf index 2e4ef43c..cbab80a1 100644 --- a/modules/eks-monitoring/add-ons/aws-for-fluentbit/variables.tf +++ b/modules/eks-monitoring/add-ons/aws-for-fluentbit/variables.tf @@ -10,6 +10,13 @@ variable "cw_log_retention_days" { default = 90 } +variable "refresh_interval" { + description = "FluentBit input refresh interval" + type = number + default = 60 +} + + variable "manage_via_gitops" { type = bool description = "Determines if the add-on should be managed via GitOps."