Skip to content

fix: increase readiness probe timeouts and add separate health endpoint#1879

Open
tommartensen wants to merge 3 commits into
masterfrom
tm/fix-healthz-endpoint
Open

fix: increase readiness probe timeouts and add separate health endpoint#1879
tommartensen wants to merge 3 commits into
masterfrom
tm/fix-healthz-endpoint

Conversation

@tommartensen

Copy link
Copy Markdown
Contributor

Intended effect: Eliminate most readiness probe timeouts, reduces log noise from kubelet probe connections, improving pod stability.

The default 1-second timeout was too aggressive for HTTPS probes,
causing intermittent failures when TLS handshake or response time
exceeded the limit. This resulted in frequent "TLS handshake error
... EOF" log messages and Unhealthy pod events.

Effect: Eliminates most readiness probe timeouts and reduces log
noise from kubelet probe connections, improving pod stability.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 723535d2-d7e4-44e1-8d26-2173377c20e2

📥 Commits

Reviewing files that changed from the base of the PR and between b4ff123 and 5e98a34.

📒 Files selected for processing (2)
  • chart/infra-server/templates/deployment.yaml
  • pkg/server/server.go

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a dedicated health check endpoint at /healthz that returns a successful response without authentication or redirects.
  • Bug Fixes

    • Improved service readiness monitoring with more reliable health probe timing, timeout handling, and failure thresholds.

Walkthrough

The infra-server adds a direct /healthz endpoint returning HTTP 200. Its Kubernetes readiness probe now targets that endpoint with updated timing and failure thresholds.

Changes

Health endpoint and readiness configuration

Layer / File(s) Summary
Add direct health endpoint
pkg/server/server.go
RunServer registers /healthz to return HTTP 200 without invoking root routing or authentication.
Configure readiness probe thresholds
chart/infra-server/templates/deployment.yaml
The readiness probe targets /healthz, runs every 10 seconds, allows 5 seconds, and tolerates three failures.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Kubelet
  participant infraServer
  participant healthzHandler
  Kubelet->>infraServer: GET /healthz
  infraServer->>healthzHandler: Dispatch health check
  healthzHandler-->>Kubelet: HTTP 200 OK
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the probe timeout increase and new health endpoint.
Description check ✅ Passed The description is directly related to the readiness probe and stability improvements in the changeset.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tm/fix-healthz-endpoint

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.

Adds an explicit health check endpoint that bypasses authentication
and canonical redirects. This is more robust than relying on User-Agent
detection in wrapHealthCheck, which only works after the TLS handshake
completes.

Changes:
- Add /healthz handler in server.go that always returns 200 OK
- Update readiness probe to use /healthz instead of /
- Increase probe periodSeconds from 5 to 10 to reduce probe frequency
- Keep wrapHealthCheck for GCP load balancer health checks (GoogleHC)

Effect: Eliminates authentication/redirect overhead from probe
requests and provides a more explicit, maintainable health check
mechanism. Combined with the increased timeout, this ensures reliable
readiness detection without TLS handshake errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@tommartensen tommartensen self-assigned this Jul 10, 2026
@rhacs-bot

Copy link
Copy Markdown
Contributor

A single node development cluster (infra-pr-1879) was allocated in production infra for this PR.

CI will attempt to deploy quay.io/rhacs-eng/infra-server: to it.

🔌 You can connect to this cluster with:

gcloud container clusters get-credentials infra-pr-1879 --zone us-central1-a --project acs-team-temp-dev

🛠️ And pull infractl from the deployed dev infra-server with:

nohup kubectl -n infra port-forward svc/infra-server-service 8443:8443 &
make pull-infractl-from-dev-server

🔓 You must go to to export an . Your token from the prod infra instance will not work with dev environments.

🚲 You can then use the dev infra instance e.g.:

bin/infractl -k -e localhost:8443 whoami

⚠️ Any clusters that you start using your dev infra instance should have a lifespan shorter then the development cluster instance. Otherwise they will not be destroyed when the dev infra instance ceases to exist when the development cluster is deleted. ⚠️

Further Development

☕ If you make changes, you can commit and push and CI will take care of updating the development cluster.

🚀 If you only modify configuration (chart/infra-server/configuration) or templates (chart/infra-server/{static,templates}), you can get a faster update with:

make helm-deploy

Logs

Logs for the development infra depending on your @redhat.com authuser:

Or:

kubectl -n infra logs -l app=infra-server --tail=1 -f

@tommartensen tommartensen marked this pull request as ready for review July 10, 2026 15:53
@tommartensen tommartensen requested review from a team and rhacs-bot as code owners July 10, 2026 15:53

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

🥇

Comment thread pkg/server/server.go
s.oidc.Handle(routeMux)

// Dedicated health endpoint for Kubernetes readiness probes.
// Bypasses authentication and redirects to prevent probe timeouts.

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.

Helpful comment ++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants