Skip to content

Conversation

@timflannagan
Copy link
Member

Description

This change reduces the startup probe failure threshold from 60 to 30, decreases the readiness probe period from 10s to 5s, and adds explicit timeout (1s) and failure threshold (3) values to the readiness probe.

Open question on whether setting InitialDelaySeconds to 0 for the readiness probe is better or worse than giving a second or two buffer once the startup probe finishes in the case there's a large xDS push or some other edge case.

These optimizations help improve pod startup time from up to 60s to a maximum of 30s, resulting in faster gateway deployments, especially when running the conformance suite locally.

Users can still tune these probe values with an explicit GWP attached to the relevant class || GW.

Change Type

/kind cleanup

Changelog

NONE

Additional Notes

This change reduces the startup probe failure threshold from 60 to 30,
decreases the readiness probe period from 10s to 5s, and adds explicit
timeout (1s) and failure threshold (3) values to the readiness probe.

Open question on whether setting InitialDelaySeconds to 0 for the
readiness probe is better or worse than giving a second or two
buffer once the startup probe finishes in the case there's a large
xDS push or some other edge case.

These optimizations help improve pod startup time from up to 60s to
a maximum of 30s, resulting in faster gateway deployments, especially
when running the conformance suite locally.

Signed-off-by: timflannagan <[email protected]>
Copilot AI review requested due to automatic review settings October 30, 2025 18:06
@github-actions github-actions bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none labels Oct 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adjusts Kubernetes probe timing configurations to reduce startup and readiness detection times. The changes optimize the health check parameters for faster pod initialization and service availability detection.

  • Readiness probe checks more frequently (5s vs 10s period) with explicit timeout and failure thresholds
  • Startup probe failure threshold reduced from 60 to 30, cutting maximum startup time in half (from 60s to 30s)
  • Test helper functions updated to match the new probe configurations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/deployer/gateway_parameters.go Updates default readiness and startup probe parameters with more aggressive timing
pkg/deployer/deployer_test.go Updates test probe generation functions to reflect the new default values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@howardjohn
Copy link
Contributor

howardjohn commented Oct 30, 2025

Open question on whether setting InitialDelaySeconds to 0 for the readiness probe is better or worse than giving a second or two buffer once the startup probe finishes in the case there's a large xDS push or some other edge case.

My understanding, at least in Istio-envoy and Kgw-Agentgateway, is once the probe returns true its going to always be true after that (unless it times out I guess).

So if the startup probe finished, the readiness probe is ~guaranteed to succeed with 0s buffer

InitialDelaySeconds: 0,
PeriodSeconds: 10,
PeriodSeconds: 5,
TimeoutSeconds: 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

fwiw I have seen envoy take more than 1s at load due to prometheus scrapes or large XDS pushes locking up the main thread.

But with failureThreshold 3 that is probably mitigated

Copy link
Member Author

Choose a reason for hiding this comment

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

I originally had this set to 2 before deciding to have an agent double check these values. Down to add a second buffer here

@chandler-solo chandler-solo self-requested a review October 30, 2025 18:32
PeriodSeconds: 1,
TimeoutSeconds: 2,
FailureThreshold: 60,
FailureThreshold: 30,
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, the startup, liveness, and readiness probes are should be optimized by 'least likely to cause an outage' and 'has lowest expected value of outage duration'. This leads to a few guidelines:

  • use a startupProbe
  • be cautious to startup -- really make sure you're started
  • be cautious to stop serving traffic (to fail readiness)
  • be cautious to beg k8s to restart your pod (to fail liveness)
  • be gentle on the started, ready, serving pod -- do not use expensive checks
  • only do checks that succeed in extremely highly loaded cases. e.g., an HTTP probe against a go server with GOMAXPROCS=1 is not uncommon in production scenarios, so make sure that an HTTP readiness/liveness probe does not rot in a queue

For these reasons, it's much better, once you've passed startupProbe, to use tcpSocket than to use an HTTP request.

Can we/should we wait on initial xDS updates to finish before passing startupProbe?

Why would you decrease how long startupProbe waits? In an outage, you badly want a new pod to come up.

Why not make periodSeconds for readiness and liveness '1'?

If /ready never fails after it succeeds, tcpSocket sounds good and we may not need both liveness and readiness.

Copy link
Contributor

Choose a reason for hiding this comment

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

Envoy is in C++, not go, so my GOMAXPROCS comment is wrong but illustrative -- do not expect a highly loaded Envoy (such as what would result if you, e.g., lost several k8s nodes unexpectedly) to keep responding to /ready with the same latency as before. If you must use HTTP probes for liveness or readiness, give them generous timeouts to avoid removing servers and cascading from high latency to a 100% outage.

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

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note-none

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants