Skip to content

Commit a72da7e

Browse files
authored
Merge pull request #60109 from GroceryBoyJr/kube-control
OSDOCS-4334 Improve cluster stability in high latency environments
2 parents f7f055f + bc0dcd9 commit a72da7e

6 files changed

+154
-46
lines changed

modules/nodes-cluster-worker-latency-profiles-about.adoc

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/clusters/nodes-cluster-worker-latency-profiles
4-
// * nodes/edge/nodes-edge-remote-workers. ??
5-
// * post_installation_configuration/cluster-tasks ??
3+
// scalability_and_performance/scaling-worker-latency-profiles.adoc
64

75
:_mod-docs-content-type: CONCEPT
86
[id="nodes-cluster-worker-latency-profiles-about_{context}"]
97
= Understanding worker latency profiles
108

11-
Worker latency profiles are multiple sets of carefully-tuned values for the `node-status-update-frequency`, `node-monitor-grace-period`, `default-not-ready-toleration-seconds` and `default-unreachable-toleration-seconds` parameters. These parameters let you control the reaction of the cluster to latency issues without needing to determine the best values manually.
9+
Worker latency profiles are four different categories of carefully-tuned parameters. The four parameters which implement these values are `node-status-update-frequency`, `node-monitor-grace-period`, `default-not-ready-toleration-seconds` and `default-unreachable-toleration-seconds`. These parameters can use values which allow you control the reaction of the cluster to latency issues without needing to determine the best values using manual methods.
10+
11+
[IMPORTANT]
12+
====
13+
Setting these parameters manually is not supported. Incorrect parameter settings adversely affect cluster stability.
14+
====
1215

1316
All worker latency profiles configure the following parameters:
1417

1518
--
16-
* `node-status-update-frequency`. Specifies the amount of time in seconds that a kubelet updates its status to the Kubernetes Controller Manager Operator.
17-
* `node-monitor-grace-period`. Specifies the amount of time in seconds that the Kubernetes Controller Manager Operator waits for an update from a kubelet before marking the node unhealthy and adding the `node.kubernetes.io/not-ready` or `node.kubernetes.io/unreachable` taint to the node.
18-
* `default-not-ready-toleration-seconds`. Specifies the amount of time in seconds after marking a node unhealthy that the Kubernetes Controller Manager Operator waits before evicting pods from that node.
19-
* `default-unreachable-toleration-seconds`. Specifies the amount of time in seconds after marking a node unreachable that the Kubernetes Controller Manager Operator waits before evicting pods from that node.
19+
node-status-update-frequency:: Specifies how often the kubelet posts node status to the API server.
20+
node-monitor-grace-period:: Specifies the amount of time in seconds that the Kubernetes Controller Manager waits for an update from a kubelet before marking the node unhealthy and adding the `node.kubernetes.io/not-ready` or `node.kubernetes.io/unreachable` taint to the node.
21+
default-not-ready-toleration-seconds:: Specifies the amount of time in seconds after marking a node unhealthy that the Kube API Server Operator waits before evicting pods from that node.
22+
default-unreachable-toleration-seconds:: Specifies the amount of time in seconds after marking a node unreachable that the Kube API Server Operator waits before evicting pods from that node.
2023
--
2124

22-
[IMPORTANT]
23-
====
24-
Manually modifying the `node-monitor-grace-period` parameter is not supported.
25-
====
26-
2725
The following Operators monitor the changes to the worker latency profiles and respond accordingly:
2826

2927
* The Machine Config Operator (MCO) updates the `node-status-update-frequency` parameter on the worker nodes.
30-
* The Kubernetes Controller Manager Operator updates the `node-monitor-grace-period` parameter on the control plane nodes.
31-
* The Kubernetes API Server Operator updates the `default-not-ready-toleration-seconds` and `default-unreachable-toleration-seconds` parameters on the control plance nodes.
28+
* The Kubernetes Controller Manager updates the `node-monitor-grace-period` parameter on the control plane nodes.
29+
* The Kubernetes API Server Operator updates the `default-not-ready-toleration-seconds` and `default-unreachable-toleration-seconds` parameters on the control plane nodes.
3230
3331
ifndef::openshift-rosa,openshift-dedicated[]
3432
Although the default configuration works in most cases, {product-title} offers two other worker latency profiles for situations where the network is experiencing higher latency than usual. The three worker latency profiles are described in the following sections:
@@ -37,9 +35,11 @@ ifdef::openshift-rosa,openshift-dedicated[]
3735
Although the default configuration works in most cases, {product-title} offers a second worker latency profile for situations where the network is experiencing higher latency than usual. The two worker latency profiles are described in the following sections:
3836
endif::openshift-rosa,openshift-dedicated[]
3937

40-
Default worker latency profile:: With the `Default` profile, each kubelet reports its node status to the Kubelet Controller Manager Operator (kube controller) every 10 seconds. The Kubelet Controller Manager Operator checks the kubelet for a status every 5 seconds.
38+
Default worker latency profile:: With the `Default` profile, each `Kubelet` updates it's status every 10 seconds (`node-status-update-frequency`). The `Kube Controller Manager` checks the statuses of `Kubelet` every 5 seconds (`node-monitor-grace-period`).
4139
+
42-
The Kubernetes Controller Manager Operator waits 40 seconds for a status update before considering that node unhealthy. It marks the node with the `node.kubernetes.io/not-ready` or `node.kubernetes.io/unreachable` taint and evicts the pods on that node. If a pod on that node has the `NoExecute` toleration, the pod gets evicted in 300 seconds. If the pod has the `tolerationSeconds` parameter, the eviction waits for the period specified by that parameter.
40+
The Kubernetes Controller Manager waits 40 seconds for a status update from `Kubelet` before considering the `Kubelet` unhealthy. If no status is made available to the Kubernetes Controller Manager, it then marks the node with the `node.kubernetes.io/not-ready` or `node.kubernetes.io/unreachable` taint and evicts the pods on that node.
41+
+
42+
If a pod on that node has the `NoExecute` taint, the pod is run according to `tolerationSeconds`. If the pod has no taint, it will be evicted in 300 seconds (`default-not-ready-toleration-seconds` and `default-unreachable-toleration-seconds` settings of the `Kube API Server`).
4343
+
4444
[cols="2,1,2,1"]
4545
|===
@@ -54,21 +54,21 @@ The Kubernetes Controller Manager Operator waits 40 seconds for a status update
5454
| `node-monitor-grace-period`
5555
| 40s
5656

57-
| Kubernetes API Server
57+
| Kubernetes API Server Operator
5858
| `default-not-ready-toleration-seconds`
5959
| 300s
6060

61-
| Kubernetes API Server
61+
| Kubernetes API Server Operator
6262
| `default-unreachable-toleration-seconds`
6363
| 300s
6464

6565
|===
6666

6767
Medium worker latency profile:: Use the `MediumUpdateAverageReaction` profile if the network latency is slightly higher than usual.
6868
+
69-
The `MediumUpdateAverageReaction` profile reduces the frequency of kubelet updates to 20 seconds and changes the period that the Kubernetes Controller Manager Operator waits for those updates to 2 minutes. The pod eviction period for a pod on that node is reduced to 60 seconds. If the pod has the `tolerationSeconds` parameter, the eviction waits for the period specified by that parameter.
69+
The `MediumUpdateAverageReaction` profile reduces the frequency of kubelet updates to 20 seconds and changes the period that the Kubernetes Controller Manager waits for those updates to 2 minutes. The pod eviction period for a pod on that node is reduced to 60 seconds. If the pod has the `tolerationSeconds` parameter, the eviction waits for the period specified by that parameter.
7070
+
71-
The Kubernetes Controller Manager Operator waits for 2 minutes to consider a node unhealthy. In another minute, the eviction process starts.
71+
The Kubernetes Controller Manager waits for 2 minutes to consider a node unhealthy. In another minute, the eviction process starts.
7272
+
7373
[cols="2,1,2,1"]
7474
|===
@@ -83,22 +83,23 @@ The Kubernetes Controller Manager Operator waits for 2 minutes to consider a nod
8383
| `node-monitor-grace-period`
8484
| 2m
8585

86-
| Kubernetes API Server
86+
| Kubernetes API Server Operator
8787
| `default-not-ready-toleration-seconds`
8888
| 60s
8989

90-
| Kubernetes API Server
90+
| Kubernetes API Server Operator
9191
| `default-unreachable-toleration-seconds`
9292
| 60s
9393

9494
|===
9595

9696
ifndef::openshift-rosa,openshift-dedicated[]
97+
9798
Low worker latency profile:: Use the `LowUpdateSlowReaction` profile if the network latency is extremely high.
9899
+
99-
The `LowUpdateSlowReaction` profile reduces the frequency of kubelet updates to 1 minute and changes the period that the Kubernetes Controller Manager Operator waits for those updates to 5 minutes. The pod eviction period for a pod on that node is reduced to 60 seconds. If the pod has the `tolerationSeconds` parameter, the eviction waits for the period specified by that parameter.
100+
The `LowUpdateSlowReaction` profile reduces the frequency of kubelet updates to 1 minute and changes the period that the Kubernetes Controller Manager waits for those updates to 5 minutes. The pod eviction period for a pod on that node is reduced to 60 seconds. If the pod has the `tolerationSeconds` parameter, the eviction waits for the period specified by that parameter.
100101
+
101-
The Kubernetes Controller Manager Operator waits for 5 minutes to consider a node unhealthy. In another minute, the eviction process starts.
102+
The Kubernetes Controller Manager waits for 5 minutes to consider a node unhealthy. In another minute, the eviction process starts.
102103
+
103104
[cols="2,1,2,1"]
104105
|===
@@ -113,11 +114,11 @@ The Kubernetes Controller Manager Operator waits for 5 minutes to consider a nod
113114
| `node-monitor-grace-period`
114115
| 5m
115116

116-
| Kubernetes API Server
117+
| Kubernetes API Server Operator
117118
| `default-not-ready-toleration-seconds`
118119
| 60s
119120

120-
| Kubernetes API Server
121+
| Kubernetes API Server Operator
121122
| `default-unreachable-toleration-seconds`
122123
| 60s
123124

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Module included in the following assemblies:
2+
//
3+
// scalability_and_performance/scaling-worker-latency-profiles.adoc
4+
5+
6+
:_mod-docs-content-type: PROCEDURE
7+
[id="nodes-cluster-worker-latency-profiles-examining_{context}"]
8+
= Example steps for displaying resulting values of workerLatencyProfile
9+
10+
You can display the values in the `workerLatencyProfile` with the following commands.
11+
12+
.Verification
13+
14+
. Check the `default-not-ready-toleration-seconds` and `default-unreachable-toleration-seconds` fields output by the Kube API Server:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc get KubeAPIServer -o yaml | grep -A 1 default-
19+
----
20+
+
21+
.Example output
22+
[source,terminal]
23+
----
24+
default-not-ready-toleration-seconds:
25+
- "300"
26+
default-unreachable-toleration-seconds:
27+
- "300"
28+
----
29+
30+
. Check the values of the `node-monitor-grace-period` field from the Kube Controller Manager:
31+
+
32+
[source,terminal]
33+
----
34+
$ oc get KubeControllerManager -o yaml | grep -A 1 node-monitor
35+
----
36+
+
37+
.Example output
38+
[source,terminal]
39+
----
40+
node-monitor-grace-period:
41+
- 40s
42+
----
43+
44+
. Check the `nodeStatusUpdateFrequency` value from the Kubelet. Set the directory `/host` as the root directory within the debug shell. By changing the root directory to `/host`, you can run binaries contained in the host’s executable paths:
45+
+
46+
[source,terminal]
47+
----
48+
$ oc debug node/<worker-node-name>
49+
$ chroot /host
50+
# cat /etc/kubernetes/kubelet.conf|grep nodeStatusUpdateFrequency
51+
----
52+
+
53+
.Example output
54+
[source,terminal]
55+
----
56+
“nodeStatusUpdateFrequency”: “10s”
57+
----
58+
59+
These outputs validate the set of timing variables for the Worker Latency Profile.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * scalability_and_performance/scaling-worker-latency-profiles.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="nodes-cluster-worker-latency-profiles-using-at-creation_{context}"]
7+
= Implementing worker latency profiles at cluster creation
8+
9+
[IMPORTANT]
10+
====
11+
To edit the configuration of the installer, you will first need to use the command `openshift-install create manifests` to create the default node manifest as well as other manifest YAML files. This file structure must exist before we can add workerLatencyProfile. The platform on which you are installing may have varying requirements. Refer to the Installing section of the documentation for your specific platform.
12+
====
13+
14+
The `workerLatencyProfile` must be added to the manifest in the following sequence:
15+
16+
. Create the manifest needed to build the cluster, using a folder name appropriate for your installation.
17+
. Create a YAML file to define `config.node`. The file must be in the `manifests` directory.
18+
. When defining `workerLatencyProfile` in the manifest for the first time, specify any of the profiles at cluster creation time: `Default`, `MediumUpdateAverageReaction` or `LowUpdateSlowReaction`.
19+
20+
.Verification
21+
* Here is an example manifest creation showing the `spec.workerLatencyProfile` `Default` value in the manifest file:
22+
+
23+
[source,terminal]
24+
----
25+
$ openshift-install create manifests --dir=<cluster-install-dir>
26+
----
27+
* Edit the manifest and add the value. In this example we use `vi` to show an example manifest file with the "Default" `workerLatencyProfile` value added:
28+
+
29+
[source,terminal]
30+
----
31+
$ vi <cluster-install-dir>/manifests/config-node-default-profile.yaml
32+
----
33+
+
34+
.Example output
35+
[source,yaml]
36+
----
37+
apiVersion: config.openshift.io/v1
38+
kind: Node
39+
metadata:
40+
name: cluster
41+
spec:
42+
workerLatencyProfile: "Default"
43+
----

modules/nodes-cluster-worker-latency-profiles-using.adoc

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
// Module included in the following assemblies:
22
//
3-
// * nodes/clusters/nodes-cluster-worker-latency-profiles
4-
// * Need to determine if these are good locations:
5-
// * nodes/edge/nodes-edge-remote-workers
6-
// * post_installation_configuration/cluster-tasks
3+
// scalability_and_performance/scaling-worker-latency-profiles.adoc
74

85
:_mod-docs-content-type: PROCEDURE
96
[id="nodes-cluster-worker-latency-profiles-using_{context}"]
10-
= Using worker latency profiles
7+
= Using and changing worker latency profiles
118

12-
To implement a worker latency profile to deal with network latency, edit the `node.config` object to add the name of the profile. You can change the profile at any time as latency increases or decreases.
9+
To change a worker latency profile to deal with network latency, edit the `node.config` object to add the name of the profile. You can change the profile at any time as latency increases or decreases.
1310

14-
You must move one worker latency profile at a time. For example, you cannot move directly from the `Default` profile to the `LowUpdateSlowReaction` worker latency profile. You must move from the `default` worker latency profile to the `MediumUpdateAverageReaction` profile first, then to `LowUpdateSlowReaction`. Similarly, when returning to the default profile, you must move from the low profile to the medium profile first, then to the default.
11+
You must move one worker latency profile at a time. For example, you cannot move directly from the `Default` profile to the `LowUpdateSlowReaction` worker latency profile. You must move from the `Default` worker latency profile to the `MediumUpdateAverageReaction` profile first, then to `LowUpdateSlowReaction`. Similarly, when returning to the `Default` profile, you must move from the low profile to the medium profile first, then to `Default`.
1512

1613
[NOTE]
1714
====
@@ -100,8 +97,8 @@ spec:
10097
10198
# ...
10299
----
103-
<1> Specifies to use the low worker latency policy.
104-
+
100+
<1> Specifies use of the low worker latency policy.
101+
105102
Scheduling on each worker node is disabled as the change is being applied.
106103

107104
.Verification
@@ -136,5 +133,4 @@ $ oc get KubeControllerManager -o yaml | grep -i workerlatency -A 5 -B 5
136133
----
137134
<1> Specifies that the profile is applied and active.
138135
139-
To change the medium profile to default or change the default to medium, edit the `node.config` object and set the `spec.workerLatencyProfile` parameter to the appropriate value.
140-
136+
To change the medium profile to default or change the default to medium, edit the `node.config` object and set the `spec.workerLatencyProfile` parameter to the appropriate value.

scalability_and_performance/scaling-worker-latency-profiles.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ toc::[]
1616

1717
include::snippets/worker-latency-profile-intro.adoc[]
1818

19-
You can configure worker latency profiles when installing a cluster or at any time you notice increased latency in your cluster network.
20-
2119
include::modules/nodes-cluster-worker-latency-profiles-about.adoc[leveloffset=+1]
2220

21+
include::modules/nodes-cluster-worker-latency-profiles-using-at-creation.adoc[leveloffset=+1]
22+
2323
include::modules/nodes-cluster-worker-latency-profiles-using.adoc[leveloffset=+1]
24+
25+
include::modules/nodes-cluster-worker-latency-profiles-examining.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)