aws / aws-for-fluent-bit

The source of the amazon/aws-for-fluent-bit container image
Apache License 2.0
461 stars 134 forks source link

Denied the request: Config map has too many chars #324

Open jeraldsm opened 2 years ago

jeraldsm commented 2 years ago

When we try to add 20 or more outputs to the aws-logging ConfigMap, then we get the below error and the config map fails to update.

admission webhook "0500-amazon-eks-fargate-configmaps-admission.amazonaws.com" denied the request: Config map has too many chars.

---
apiVersion: v1
kind: ConfigMap
metadata:
  name: aws-logging
  namespace: aws-observability
data:
  output.conf: |        
    [OUTPUT]
      Name cloudwatch_logs
      Match *kube.var.log.containers.app1*
      region eu-central-1
      log_group_name app1-cw-log
      log_stream_prefix from-fluent-bit-
      auto_create_group False
.
.
.
.

    [OUTPUT]
      Name cloudwatch_logs
      Match *kube.var.log.containers.app20*
      region eu-central-1
      log_group_name app20-cw-log
      log_stream_prefix from-fluent-bit-
      auto_create_group False

  parsers.conf: |
    [PARSER]
        Name crio
        Format Regex
        Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>P|F) (?<log>.*)$
        Time_Key    time
        Time_Format %Y-%m-%dT%H:%M:%S.%L%z

  filters.conf: |
     [FILTER]
        Name parser
        Match *
        Key_name log
        Parser crio

Can I get some help to resolve this issue ?

matthewfala commented 2 years ago

Hi, This is currently due to a limitation of EKS. Since these configuration settings are merged into a single fluent bit configuration file and there is some template logic that currently has a line restriction. Our team doesn't directly manage this software, but I can check with the team that does to see if there's a blocker on allowing more lines.

Why do you need so many lines and how many lines would you need, for reference?

jeraldsm commented 2 years ago

Hi @matthewfala

We are creating cloudwatch log group per application and there are more than 20 apps, therefore, there are a lot of lines.

We also raised a support ticket with AWS and they informed us this can be fixed only by reducing characters.

The limitation comes because the configmap is passed to the Fargate Container as overrides parameter and the character limit for "overrides"is 8192 as mentioned here This is a hard limit that cannot be increased

jatinmehrotra commented 10 months ago

Is there any update to this @jeraldsm

How did you solved this? I am experiencing the same