
Implements KEP 2000, Graceful Node Shutdown: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2000-graceful-node-shutdown * Add new FeatureGate `GracefulNodeShutdown` to control enabling/disabling the feature * Add two new KubeletConfiguration options * `ShutdownGracePeriod` and `ShutdownGracePeriodCriticalPods` * Add new package, `nodeshutdown` that implements the Node shutdown manager * The node shutdown manager uses the systemd inhibit package, to create an system inhibitor, monitor for node shutdown events, and gracefully terminate pods upon a node shutdown.
44 lines
1.3 KiB
Go
44 lines
1.3 KiB
Go
// +build !linux
|
|
|
|
/*
|
|
Copyright 2020 The Kubernetes Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
package nodeshutdown
|
|
|
|
import (
|
|
"time"
|
|
|
|
"k8s.io/kubernetes/pkg/kubelet/eviction"
|
|
)
|
|
|
|
// Manager is a fake node shutdown manager for non linux platforms.
|
|
type Manager struct{}
|
|
|
|
// NewManager returns a fake node shutdown manager for non linux platforms.
|
|
func NewManager(getPodsFunc eviction.ActivePodsFunc, killPodFunc eviction.KillPodFunc, shutdownGracePeriodRequested, shutdownGracePeriodCriticalPods time.Duration) *Manager {
|
|
return &Manager{}
|
|
}
|
|
|
|
// Start is a no-op always returning nil for non linux platforms.
|
|
func (m *Manager) Start() error {
|
|
return nil
|
|
}
|
|
|
|
// ShutdownStatus is a no-op always returning nil for non linux platforms.
|
|
func (m *Manager) ShutdownStatus() error {
|
|
return nil
|
|
}
|