Open markusthoemmes opened 10 months ago
The second option looks good, Prometheus operator uses another approach as I know @wanjunlei @wenchajun what do you think?
I also think the second one is better.
As mentioned by @wanjunlei , by adding the config generation logic into the watcher sidecar, we can also try to enable the config hot reload feature of fluentbit and remove the logic in the watcher to restart the fluentbit process whenever config changes. @markusthoemmes
@wanjunlei do you have any tips for @markusthoemmes to implement this?
Config generation itself should be fairly straightforward for me to implement in the watcher. I'd imagine that's a bit of RBAC + moving the code + adding a few flags to control new/old behavior.
Hot reload would indeed be an interesting followup, but I think we should keep those concerns separate.
This made me wonder actually: Once config generation is inside the watcher, do we need the fluentbit-manager itself at that point? We could pass FluentBitConfigName
and NamespacedFluentBitCfgSelector
to the watcher via flags and then "just" apply a DaemonSet with the fluentbit config we desire (in "native" K8s) vs. mirroring all of the fields in the ClusterFluentBitConfig
🤔 .
I guess it's somewhat orthogonal but I'd be interested in exploring that angle potentially as well. It would simplify the operator and give the user more power for deciding how to deploy fluent bit under the hood.
Another idea would be to support the YAML configuration syntax for Fluent Bit, which itself supports includes, so that large config sections can potentially be split up into multiple files somehow.
This is, I'm sure, a much larger change, but at least a few people have asked for it (ex: #1008).
any update on this one? or is there any work around on this one?
Is your feature request related to a problem? Please describe.
Kubernetes Secrets are limited in size by what's configured in etcd. Frequently, that limit is 1MB. Currently, the entire configuration for fluentbit is eventually written to a single secret, even if namespaced CRDs are used. That secret is then mounted into the fluentbit containers and eventually read by the fluentbit process to act on it.
Due to the intermediate write to a secret, very large configs eventually fail to be processed because the secret can no longer be written to.
Describe the solution you'd like
There's essentially 2 ways I can think about fixing this, one being a "not really a fix" 😅 .
gzip
drops the size to 34K, just 6,7% of the initial size! Obviously, this is not a "solution" to the initial problem but rather a way to kick the stone down the street for longer. Eventually, at enough scale, the problem will reappear. It is however fairly easy to implement in that the controller would only have to learn how to write the secret in a gzipped way and the watcher would have to learn how to deal with reading gzippedI'd love to get feedback on either of these small outlines. If acceptable, I'd be happy to work either approach into a full-blown proposal and contribute the respective necessary changes.
Additional context
No response