Add flag to allow setting a shutdown grace period
This commit is contained in:
parent
032fccb292
commit
54b13bd216
6 changed files with 140 additions and 0 deletions
|
|
@ -106,6 +106,8 @@ type Configuration struct {
|
|||
MaxmindEditionFiles []string
|
||||
|
||||
MonitorMaxBatchSize int
|
||||
|
||||
ShutdownGracePeriod int
|
||||
}
|
||||
|
||||
// GetPublishService returns the Service used to set the load-balancer status of Ingresses.
|
||||
|
|
|
|||
|
|
@ -367,6 +367,8 @@ func (n *NGINXController) Stop() error {
|
|||
return fmt.Errorf("shutdown already in progress")
|
||||
}
|
||||
|
||||
time.Sleep(time.Duration(n.cfg.ShutdownGracePeriod) * time.Second)
|
||||
|
||||
klog.InfoS("Shutting down controller queues")
|
||||
close(n.stopCh)
|
||||
go n.syncQueue.Shutdown()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue