Commit Graph

12 Commits

Author SHA1 Message Date
JUN YANG
90bfd38b83 Structured Logging migration: modify node and pod part logs of kubelet.
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-03-13 12:31:09 +08:00
David Porter
893f5fd4f0 Promote kubelet graceful node shutdown to beta
- Change the feature gate from alpha to beta and enable it by default

- Update a few of the unit tests due to feature gate being enabled by
  default

- Small refactor in `nodeshutdown_manager` which adds `featureEnabled`
  function (which checks that feature gate and that
  `kubeletConfig.ShutdownGracePeriod > 0`).

- Use `featureEnabled()` to exit early from shutdown manager in the case
  that the feature is disabled

- Update kubelet config defaulting to be explicit that
  `ShutdownGracePeriod` and `ShutdownGracePeriodCriticalPods` default to
  zero and update the godoc comments.

- Update defaults and add featureGate tag in api config godoc.

With this feature now in beta and the feature gate enabled by default,
to enable graceful shutdown all that will be required is to configure
`ShutdownGracePeriod` and `ShutdownGracePeriodCriticalPods` in the
kubelet config. If not configured, they will be defaulted to zero, and
graceful shutdown will effectively be disabled.
2021-03-05 15:21:37 -08:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Kubernetes Prow Robot
9ec1e23e41
Merge pull request #98005 from wzshiming/fix-rescheduling-to-the-shutdown-node
Sync node status during kubelet node shutdown
2021-01-28 17:51:53 -08:00
Kubernetes Prow Robot
82ebcd1719
Merge pull request #98088 from wzshiming/fix-inhibit-lock
Fix repeatedly aquire the inhibit lock
2021-01-22 00:37:26 -08:00
wzshiming
d9df265af0 Sync node status during kubelet node shutdown 2021-01-21 11:01:13 +08:00
Kubernetes Prow Robot
737858cd7c
Merge pull request #98200 from wzshiming/fix-node-shutdown-events
Fix kubelet from panic after getting the wrong signal
2021-01-20 10:38:47 -08:00
wzshiming
4e17e58552 Fix repeatedly aquire the inhibit lock 2021-01-15 10:49:11 +08:00
wzshiming
0413529b62 Fix dbus shutdown events not continuing if they are not valid 2021-01-12 14:33:39 +08:00
wzshiming
0911b5ec79 remove executable permission bits 2021-01-12 13:32:23 +08:00
David Porter
16f71c6d47 Implement shutdown manager in kubelet
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.
2020-11-12 21:47:55 +00:00
David Porter
2343689ce7 Add systemd package to interface with dbus
* Add a new package under nodeshutdown "systemd"
  * Package uses dbus to interface with logind to manage shutdown
  inhibitors
* Make github.com/godbus/dbus a new explicit dependency
  * Update vendor and go modules
2020-11-12 21:46:44 +00:00