File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
staging/src/k8s.io/apiserver/pkg/server Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -318,8 +318,14 @@ func (s preparedGenericAPIServer) Run(stopCh <-chan struct{}) error {
318
318
319
319
go func () {
320
320
defer close (delayedStopCh )
321
+
321
322
<- stopCh
322
323
324
+ // As soon as shutdown is initiated, /readyz should start returning failure.
325
+ // This gives the load balancer a window defined by ShutdownDelayDuration to detect that /readyz is red
326
+ // and stop sending traffic to this server.
327
+ close (s .readinessStopCh )
328
+
323
329
time .Sleep (s .ShutdownDelayDuration )
324
330
}()
325
331
@@ -379,7 +385,6 @@ func (s preparedGenericAPIServer) NonBlockingRun(stopCh <-chan struct{}) error {
379
385
// ensure cleanup.
380
386
go func () {
381
387
<- stopCh
382
- close (s .readinessStopCh )
383
388
close (internalStopCh )
384
389
if stoppedCh != nil {
385
390
<- stoppedCh
You can’t perform that action at this time.
0 commit comments