You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you restart the kubelet, Pods (and their containers) continue to run
964
+
even during the restart.
965
+
When there are running Pods on a node, stopping or restarting the kubelet
966
+
on that node does **not** cause the kubelet to stop all local Pods
967
+
before the kubelet itself stops.
968
+
To stop the Pods on a node, you can use `kubectl drain`.
964
969
965
-
If the node's `KubeletReady` condition remains unchanged, meaning its `Ready` condition does not transition from true to false, we consider it a kubelet restart.
When the kubelet starts, it checks to see if there is already a Node with
973
+
bound Pods.
974
+
If the Node's [`Ready` condition](/docs/reference/node/node-status/#condition) remains unchanged,
975
+
in other words the condition has not transitioned from true to false, Kubernetes detects this a _kubelet restart_.
976
+
(It's possible to restart the kubelet in other ways, for example to fix a node bug,
977
+
but in these cases, Kubernetes picks the safe option and treats this as if you
978
+
stopped the kubelet and then later started it).
966
979
967
980
When the kubelet restarts, the container statuses are managed differently based on the feature gate setting:
968
981
969
-
* With the `ChangeContainerStatusOnKubeletRestart` feature gate disabled (the default), the kubelet does not change container statuses after a restart. Containers that were in a Ready state remain Ready.
970
-
971
-
* With the feature gate enabled, and containers within the pod have a readiness probe, the kubelet will modify the container's Ready status after restart to be not ready. This behavior was the default for a long time and caused issues in large scale deployments. While the feature gate allows reverting to this legacy behavior temporarily, it is recommended to file a bug report if you encounter problems. Note that this feature gate will be removed in the future.
982
+
* By default, the kubelet does not change container statuses after a restart.
983
+
Containers that were in set to `ready: true` state remain remain ready.
984
+
985
+
If you stop the kubelet long enough for it to fail a series of
and then you wait before you start the kubelet again, Kubernetes may begin to evict Pods from that Node.
988
+
However, even though Pod evictions begin to happen, Kubernetes does not mark the
989
+
individual containers in those Pods as `ready: false`. The Pod-level eviction
990
+
happens after the control plane taints the node as `node.kubernetes.io/not-ready` (due to the failed heartbeats).
991
+
992
+
* In Kubernetes {{< skew currentVersion >}} you can opt in to a legacy behavior where the kubelet always modify the containers `ready` value, after a kubelet restart, to be false.
993
+
This legacy behavior was the default for a long time, but caused issue for people using Kubernetes, especially in large scale deployments.
994
+
Althought the feature gate allows reverting to this legacy behavior temporarily, the Kubernetes project recommends that you file a bug report if you encounter problems.
995
+
The `ChangeContainerStatusOnKubeletRestart` feature gate will be removed in
Copy file name to clipboardExpand all lines: content/en/docs/reference/command-line-tools-reference/feature-gates/ChangeContainerStatusOnKubeletRestart.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,6 @@ stages:
10
10
defaultValue: false
11
11
fromVersion: "1.35"
12
12
---
13
-
When disabled, kubelet restarts will not change the status of Pods already running on the node,
14
-
This Feature Gate was introduced to allow revert the behavior to previously used default.
15
-
13
+
This feature gate was introduced to allow you revert the behavior to previously used default.
14
+
If you are satisfied with the default behavior, you do not need to enable this
0 commit comments