Skip to content

Commit 459952a

Browse files
committed
Windows node graceful shutdown
1 parent 3140807 commit 459952a

File tree

10 files changed

+1243
-11
lines changed

10 files changed

+1243
-11
lines changed

cmd/kubelet/app/init_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func initForOS(windowsService bool, windowsPriorityClass string) error {
8989
}
9090

9191
if windowsService {
92-
return service.InitService(serviceName)
92+
return service.InitServiceWithShutdown(serviceName)
9393
}
9494
return nil
9595
}

pkg/features/kube_features.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,13 @@ const (
703703
// Allows kube-proxy to create DSR loadbalancers for Windows
704704
WinDSR featuregate.Feature = "WinDSR"
705705

706+
// owner: @zylxjtu
707+
// kep: https://kep.k8s.io/4802
708+
// alpha: v1.32
709+
//
710+
// Enables support for graceful shutdown windows node.
711+
WindowsGracefulNodeShutdown featuregate.Feature = "WindowsGracefulNodeShutdown"
712+
706713
// owner: @ksubrmnn
707714
//
708715
// Allows kube-proxy to run in Overlay mode for Windows

pkg/features/versioned_kube_features.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,9 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
762762
WinDSR: {
763763
{Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha},
764764
},
765-
765+
WindowsGracefulNodeShutdown: {
766+
{Version: version.MustParse("1.32"), Default: false, PreRelease: featuregate.Alpha},
767+
},
766768
WinOverlay: {
767769
{Version: version.MustParse("1.14"), Default: false, PreRelease: featuregate.Alpha},
768770
{Version: version.MustParse("1.20"), Default: true, PreRelease: featuregate.Beta},

pkg/kubelet/nodeshutdown/nodeshutdown_manager_others.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//go:build !linux
2-
// +build !linux
1+
//go:build !linux && !windows
2+
// +build !linux,!windows
33

44
/*
55
Copyright 2020 The Kubernetes Authors.
@@ -19,7 +19,7 @@ limitations under the License.
1919

2020
package nodeshutdown
2121

22-
// NewManager returns a fake node shutdown manager for non linux platforms.
22+
// NewManager returns a fake node shutdown manager for unsupported platforms.
2323
func NewManager(conf *Config) Manager {
2424
m := managerStub{}
2525
return m

0 commit comments

Comments
 (0)