Skip to content

feat(fluent-bit-output-plugin): Add dynamic CRD detection#515

Merged
iypetrov merged 13 commits into
gardener:masterfrom
iypetrov:feat-use-dynamic-informer-to-watch-for-crds
Jun 18, 2026
Merged

feat(fluent-bit-output-plugin): Add dynamic CRD detection#515
iypetrov merged 13 commits into
gardener:masterfrom
iypetrov:feat-use-dynamic-informer-to-watch-for-crds

Conversation

@iypetrov

@iypetrov iypetrov commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

How to categorize this PR?

/kind enhancement
/area logging

What this PR does / why we need it:
Currently, the Fluent Bit plugin depends on two CRDs to determine the correct log destination based on the environment in which it is deployed:

  • Clusters from the extensions.gardener.cloud API group
  • OpenTelemetryCollector from the opentelemetry.io API group

Previously, if the plugin was deployed before the required CRD became available, it would fail to start and crash. While this was partially mitigated in the Gardener environment because the fluent-operator continuously restarts failed processes until the CRD appears, relying on restart retries is not a robust solution. In certain scenarios, this behavior could lead to instability and potential log loss.

To address this issue, a CRD availability watch mechanism has been introduced for both dependencies. When the required CRD is not available, the plugin automatically routes logs to a fallback OTLP backend, which corresponds to the seed's logging stack. Once the required CRD becomes available, the plugin dynamically switches traffic to the intended destination without requiring a restart.

This approach significantly improves resilience and reliability by eliminating the dependency on repeated process restarts. It also makes the plugin more flexible across different deployment scenarios, ensuring predictable behavior regardless of the order in which components and CRDs become available.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:

Improved Fluent Bit resilience by adding dynamic CRD detection and automatic fallback log routing, preventing startup failures when required CRDs are not yet available.

iypetrov added 3 commits June 15, 2026 22:11
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
@iypetrov iypetrov requested a review from nickytd as a code owner June 17, 2026 06:28
@gardener-prow gardener-prow Bot added the area/logging Logging related label Jun 17, 2026
@gardener-prow

gardener-prow Bot commented Jun 17, 2026

Copy link
Copy Markdown

@iypetrov: The label(s) kind/todo cannot be applied, because the repository doesn't have them.

Details

In response to this:

How to categorize this PR?

/kind TODO
/area logging

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@gardener-prow gardener-prow Bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 17, 2026
@iypetrov iypetrov marked this pull request as draft June 17, 2026 06:29
@gardener-prow gardener-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 17, 2026
iypetrov added 5 commits June 17, 2026 09:34
…ewPluginWithController

Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
@gardener-prow gardener-prow Bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 17, 2026
@iypetrov iypetrov changed the title Feat use dynamic informer to watch for crds feat(fluent-bit-output-plugin): Add Dynamic CRD Detection Jun 18, 2026
@iypetrov iypetrov changed the title feat(fluent-bit-output-plugin): Add Dynamic CRD Detection feat(fluent-bit-output-plugin): Add dynamic CRD detection Jun 18, 2026
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
@iypetrov iypetrov self-assigned this Jun 18, 2026
iypetrov added 3 commits June 18, 2026 10:32
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
@iypetrov iypetrov marked this pull request as ready for review June 18, 2026 09:08
@gardener-prow gardener-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 18, 2026
@iypetrov

Copy link
Copy Markdown
Contributor Author

/cc @nickytd @plkokanov

@gardener-prow

gardener-prow Bot commented Jun 18, 2026

Copy link
Copy Markdown

@iypetrov: GitHub didn't allow me to request PR reviews from the following users: plkokanov.

Note that only gardener members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/cc @nickytd @plkokanov

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@nickytd nickytd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-prow gardener-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 18, 2026
@gardener-prow

gardener-prow Bot commented Jun 18, 2026

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: 659f4f35f3ba8d950a7e4f8ef94f628fb0028214

@gardener-prow gardener-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2026
Signed-off-by: Ilia Petrov <ilia.yavorov.petrov@gmail.com>
@gardener-prow gardener-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 18, 2026
@iypetrov iypetrov added kind/enhancement Enhancement, improvement, extension and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jun 18, 2026
@iypetrov iypetrov enabled auto-merge (squash) June 18, 2026 12:19
@iypetrov iypetrov requested a review from nickytd June 18, 2026 12:20

@nickytd nickytd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-prow gardener-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 18, 2026
@gardener-prow

gardener-prow Bot commented Jun 18, 2026

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: 5154a154a074349c01c2c0828db349a974dc33d3

@gardener-prow

gardener-prow Bot commented Jun 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nickytd

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@iypetrov iypetrov merged commit 18858b5 into gardener:master Jun 18, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/logging Logging related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants