Skip to content

fix(monitoring-agents): relax fluent-bit probes for loaded installs - #3045

Merged
IvanHunters merged 1 commit into
mainfrom
ray/fix-fluentbit-liveness-probe
Jun 25, 2026
Merged

IvanHunters merged 1 commit into
mainfrom
ray/fix-fluentbit-liveness-probe

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Problem

On a loaded install the monitoring-agents fluent-bit DaemonSet crash-loops and its HelmRelease times out (timeout waiting for: [DaemonSet/.../monitoring-agents-fluent-bit status: 'InProgress']), cascading into velero → backupstrategy-controller DependencyNotReady and failing the whole install.

Root cause: fluent-bit's HTTP server on :2020 (the liveness/readiness target) binds only AFTER the filter:kubernetes "testing connectivity with API server" step. During a concurrent install the kube-API can be unreachable for ~10s (observed connection #144 timeout after 10 seconds to: kubernetes.default.svc:443), which delays the :2020 bind. The vendored subchart's default probes (initialDelaySeconds 0, timeoutSeconds 1, failureThreshold 3) fire into a connection-refused port immediately, and the single-threaded HTTP server can't always meet a 1s timeout while the engine is busy — so liveness SIGTERMs fluent-bit (exitCode 0, not OOM) into a restart loop.

Fix

Relax both probes in the first-party umbrella values.yaml fluent-bit: block: initialDelaySeconds 15, periodSeconds 10, timeoutSeconds 5, failureThreshold 6 (~75s tolerance from container start, ~60s steady-state). The httpGet target is unchanged — path / on port http (:2020). The change is values-only; the vendored subchart is not touched.

Why load-triggered (not always-broken)

A steady-state cluster runs the identical probe config with the DaemonSet 3/3 Ready, 0 restarts, 26 days. The probe only fails when the :2020 bind is delayed by API unreachability under install-time load. Steady-state-stable + flaky-only-under-load = probe-too-aggressive, not a target or config error.

Test

Added a helm-unittest (tests/fluent-bit_probes_test.yaml) pinning both the relaxed timing and the preserved :2020 httpGet target (path /, port http) on the rendered DaemonSet, so a future change that re-tightens the probes or breaks the path/port is caught.

Screenshots

N/A — no UI changes.

Release note

fix(monitoring-agents): relax fluent-bit liveness/readiness probes so the DaemonSet no longer crash-loops on a loaded install when its :2020 HTTP server binds late behind a busy kube-API

Summary by CodeRabbit

  • Bug Fixes
    • Adjusted Fluent Bit health probes to use more relaxed timing, reducing the chance of restart loops on busy installations.
    • Kept the readiness check pointed at the expected HTTP path and port while making probe behavior more stable.
  • Tests
    • Added test coverage to verify the generated probe configuration stays consistent.

The fluent-bit DaemonSet crash-loops on a loaded install, timing out its
HelmRelease and cascading into velero and backupstrategy-controller
DependencyNotReady failures. The subchart default liveness/readiness probes
(initialDelaySeconds 0, timeoutSeconds 1, failureThreshold 3) target the HTTP
server on :2020, but that server does not bind until AFTER the kubernetes
filter's 'testing connectivity with API server' step. Under a concurrent
install the kube-API can be unreachable for ~10s, delaying the :2020 bind,
while the single-threaded HTTP server can miss a 1s timeout when the engine is
busy. The probes then fire into a connection-refused port and liveness-kill
fluent-bit into a restart loop.

Give both probes load headroom (initialDelaySeconds 15, timeoutSeconds 5,
failureThreshold 6) so the API-gated late bind and busy-engine blips are
tolerated. The httpGet target is unchanged (path / on port http = :2020). Add
a helm-unittest pinning the relaxed timing and the preserved target.

Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates Fluent Bit probe settings in the monitoring-agents values file, adding a liveness probe and completing the readiness probe with explicit HTTP port and timing fields. Adds YAML tests that assert the generated DaemonSet uses the / endpoint on port http and the updated timing values.

Changes

Fluent Bit probe settings

Layer / File(s) Summary
Fluent Bit probe settings and regression tests
packages/system/monitoring-agents/values.yaml, packages/system/monitoring-agents/tests/fluent-bit_probes_test.yaml
fluent-bit gains a liveness probe and a more explicit readiness probe, and the YAML test suite checks the generated probe paths, port, and relaxed timing fields.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hop by the probe with a curious ear,
/ on http makes the path quite clear.
Soft little timings keep the burrow in tune,
So Fluent Bit sniffs logs from morning to moon.
🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: relaxing Fluent Bit probes for loaded installs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ray/fix-fluentbit-liveness-probe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files labels Jun 24, 2026
@lexfrei
Aleksei Sviridkin (lexfrei) marked this pull request as ready for review June 25, 2026 14:44
@dosubot dosubot Bot added area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) area/testing Issues or PRs related to testing (e2e, bats, unit tests) labels Jun 25, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a race condition where the fluent-bit monitoring agent enters a crash-loop during concurrent cluster installations. By relaxing the liveness and readiness probe thresholds, the agent is given sufficient time to bind its HTTP server even when the Kubernetes API is temporarily unreachable or under heavy load. These changes ensure stability during the deployment phase without altering the agent's core monitoring functionality.

Highlights

  • Probe Configuration: Relaxed liveness and readiness probe settings for the fluent-bit DaemonSet to prevent crash-loops during high-load installations.
  • Regression Testing: Added a new helm-unittest file to ensure the probe timing and target configuration remain consistent in future updates.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request relaxes the liveness and readiness probe timings for Fluent Bit in the monitoring-agents package to prevent crash loops during loaded installations, and adds corresponding regression tests. The feedback suggests also applying the relaxed initialDelaySeconds and periodSeconds configurations to the readiness probe (and updating the test assertions accordingly) to ensure consistency and prevent premature connection failures during startup.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +309 to +311
port: http
timeoutSeconds: 5
failureThreshold: 6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

low

The PR description states that both probes are relaxed with initialDelaySeconds: 15 and periodSeconds: 10. However, these parameters were only added to livenessProbe and are missing from readinessProbe. Adding them to readinessProbe ensures consistency and prevents unnecessary connection attempts/failures during the initial startup phase.

      port: http
    initialDelaySeconds: 15
    periodSeconds: 10
    timeoutSeconds: 5
    failureThreshold: 6

Comment on lines +48 to +53
- equal:
path: spec.template.spec.containers[0].readinessProbe.timeoutSeconds
value: 5
- equal:
path: spec.template.spec.containers[0].readinessProbe.failureThreshold
value: 6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

low

Update the readiness probe assertions to include the relaxed initialDelaySeconds and periodSeconds values to match the suggested configuration in values.yaml.

      - equal:
          path: spec.template.spec.containers[0].readinessProbe.initialDelaySeconds
          value: 15
      - equal:
          path: spec.template.spec.containers[0].readinessProbe.periodSeconds
          value: 10
      - equal:
          path: spec.template.spec.containers[0].readinessProbe.timeoutSeconds
          value: 5
      - equal:
          path: spec.template.spec.containers[0].readinessProbe.failureThreshold
          value: 6

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/system/monitoring-agents/values.yaml`:
- Around line 306-311: The readinessProbe override is only partially relaxed
because it still relies on the subchart defaults for initialDelaySeconds and
periodSeconds. Update the readinessProbe block in values.yaml so the
monitoring-agents configuration explicitly sets those timing fields alongside
timeoutSeconds and failureThreshold, matching the intended relaxed startup
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 67a2b37c-f946-485e-84c1-1bf63c6153f1

📥 Commits

Reviewing files that changed from the base of the PR and between 29bf56f and 45a273e.

📒 Files selected for processing (2)
  • packages/system/monitoring-agents/tests/fluent-bit_probes_test.yaml
  • packages/system/monitoring-agents/values.yaml

Comment on lines 306 to +311
readinessProbe:
httpGet:
path: /
port: http
timeoutSeconds: 5
failureThreshold: 6

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Readiness probe relaxation is incomplete.

readinessProbe still omits initialDelaySeconds and periodSeconds, so those remain at subchart defaults. That does not fully match the stated relaxed timing contract and can still probe too early during loaded installs.

Suggested fix
   readinessProbe:
     httpGet:
       path: /
       port: http
+    initialDelaySeconds: 15
+    periodSeconds: 10
     timeoutSeconds: 5
     failureThreshold: 6
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
readinessProbe:
httpGet:
path: /
port: http
timeoutSeconds: 5
failureThreshold: 6
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/system/monitoring-agents/values.yaml` around lines 306 - 311, The
readinessProbe override is only partially relaxed because it still relies on the
subchart defaults for initialDelaySeconds and periodSeconds. Update the
readinessProbe block in values.yaml so the monitoring-agents configuration
explicitly sets those timing fields alongside timeoutSeconds and
failureThreshold, matching the intended relaxed startup behavior.

@IvanHunters IvanHunters 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.

Reviewed the diff. Values-only override of the subchart, vendored sources untouched. Tests pin both httpGet target and timings. Non-blocking thought: a startupProbe would canonically separate cold-start headroom from steady-state aggressiveness without widening the dead-process zombie window to 60-75s, worth considering if probe flake reappears. LGTM.

@IvanHunters
IvanHunters merged commit 857c883 into main Jun 25, 2026
19 of 20 checks passed
@IvanHunters
IvanHunters deleted the ray/fix-fluentbit-liveness-probe branch June 25, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/monitoring Issues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor) area/testing Issues or PRs related to testing (e2e, bats, unit tests) area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review kind/bug Categorizes issue or PR as related to a bug size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants