Commit bde2324e authored by MrHohn's avatar MrHohn

Support graceful termination in kube-dns

parent 29c9a373
......@@ -125,12 +125,12 @@ func (server *KubeDNSServer) setupHealthzHandlers() {
}
// 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() {
sigChan := make(chan os.Signal)
signal.Notify(sigChan, syscall.SIGINT, syscall.SIGTERM)
go func() {
glog.Fatalf("Received signal: %s", <-sigChan)
glog.Infof("Received signal: %s, will exit when the grace period ends", <-sigChan)
}()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment