apiservers: add synchronous shutdown mechanism on SIGTERM+INT
This commit is contained in:
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package main
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/kubernetes/cmd/kube-apiserver/app"
|
||||
"k8s.io/kubernetes/cmd/kube-apiserver/app/options"
|
||||
)
|
||||
@@ -32,9 +31,10 @@ func NewKubeAPIServer() *Server {
|
||||
AlternativeName: "kube-apiserver",
|
||||
SimpleUsage: "apiserver",
|
||||
Long: "The main API entrypoint and interface to the storage system. The API server is also the focal point for all authorization decisions.",
|
||||
Run: func(_ *Server, args []string) error {
|
||||
return app.Run(s, wait.NeverStop)
|
||||
Run: func(_ *Server, args []string, stopCh <-chan struct{}) error {
|
||||
return app.Run(s, stopCh)
|
||||
},
|
||||
RespectsStopCh: true,
|
||||
}
|
||||
s.AddFlags(hks.Flags())
|
||||
return &hks
|
||||
|
Reference in New Issue
Block a user