mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Support graceful termination in kube-dns
This commit is contained in:
parent
29c9a373d7
commit
bde2324eb9
@ -125,12 +125,12 @@ func (server *KubeDNSServer) setupHealthzHandlers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setupSignalHandlers runs a goroutine that waits on SIGINT or SIGTERM and logs it
|
// setupSignalHandlers runs a goroutine that waits on SIGINT or SIGTERM and logs it
|
||||||
// before exiting.
|
// program will be terminated by SIGKILL when grace period ends.
|
||||||
func setupSignalHandlers() {
|
func setupSignalHandlers() {
|
||||||
sigChan := make(chan os.Signal)
|
sigChan := make(chan os.Signal)
|
||||||
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
glog.Fatalf("Received signal: %s", <-sigChan)
|
glog.Infof("Received signal: %s, will exit when the grace period ends", <-sigChan)
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user