Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pkg/deployer/deployer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2849,7 +2849,7 @@ func generateStartupProbe() *corev1.Probe {
InitialDelaySeconds: 0,
PeriodSeconds: 1,
TimeoutSeconds: 2,
FailureThreshold: 60,
FailureThreshold: 30,
SuccessThreshold: 1,
}
}
Expand All @@ -2862,8 +2862,10 @@ func generateReadinessProbe() *corev1.Probe {
Port: intstr.FromInt(8082),
},
},
InitialDelaySeconds: 5,
PeriodSeconds: 10,
InitialDelaySeconds: 0,
PeriodSeconds: 5,
TimeoutSeconds: 1,
FailureThreshold: 3,
}
}

Expand Down
6 changes: 4 additions & 2 deletions pkg/deployer/gateway_parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ func defaultGatewayParameters(imageInfo *ImageInfo, omitDefaultSecurityContext b
},
},
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

FailureThreshold: 3,
},
StartupProbe: &corev1.Probe{
ProbeHandler: corev1.ProbeHandler{
Expand All @@ -189,7 +191,7 @@ func defaultGatewayParameters(imageInfo *ImageInfo, omitDefaultSecurityContext b
InitialDelaySeconds: 0,
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.

SuccessThreshold: 1,
},
},
Expand Down
Loading