13.3. 使用和更改 worker 延迟配置集
要更改 worker 延迟配置集以处理网络延迟,请编辑 node.config
对象以添加配置集的名称。当延迟增加或减少时,您可以随时更改配置集。
您必须一次移动一个 worker 延迟配置集。例如,您无法直接从 Default
配置集移到 LowUpdateSlowReaction
worker 延迟配置集。您必须首先从 Default
worker 延迟配置集移到 MediumUpdateAverageReaction
配置集,然后再移到 LowUpdateSlowReaction
。同样,当返回到 Default
配置集时,您必须首先从低配置集移到中配置集,然后移到 Default
。
您还可以在安装 OpenShift Container Platform 集群时配置 worker 延迟配置集。
流程
将默认的 worker 延迟配置集改为:
中 worke worker 延迟配置集:
编辑
node.config
对象:$ oc edit nodes.config/cluster
添加
spec.workerLatencyProfile: MediumUpdateAverageReaction
:node.config
对象示例apiVersion: config.openshift.io/v1 kind: Node metadata: annotations: include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" include.release.openshift.io/single-node-developer: "true" release.openshift.io/create-only: "true" creationTimestamp: "2022-07-08T16:02:51Z" generation: 1 name: cluster ownerReferences: - apiVersion: config.openshift.io/v1 kind: ClusterVersion name: version uid: 36282574-bf9f-409e-a6cd-3032939293eb resourceVersion: "1865" uid: 0c0f7a4c-4307-4187-b591-6155695ac85b spec: workerLatencyProfile: MediumUpdateAverageReaction 1 # ...
- 1
- 指定中 worker 延迟策略。
随着更改被应用,每个 worker 节点上的调度都会被禁用。
可选:改为低 worker 延迟配置集:
编辑
node.config
对象:$ oc edit nodes.config/cluster
将
spec.workerLatencyProfile
值更改为LowUpdateSlowReaction
:node.config
对象示例apiVersion: config.openshift.io/v1 kind: Node metadata: annotations: include.release.openshift.io/ibm-cloud-managed: "true" include.release.openshift.io/self-managed-high-availability: "true" include.release.openshift.io/single-node-developer: "true" release.openshift.io/create-only: "true" creationTimestamp: "2022-07-08T16:02:51Z" generation: 1 name: cluster ownerReferences: - apiVersion: config.openshift.io/v1 kind: ClusterVersion name: version uid: 36282574-bf9f-409e-a6cd-3032939293eb resourceVersion: "1865" uid: 0c0f7a4c-4307-4187-b591-6155695ac85b spec: workerLatencyProfile: LowUpdateSlowReaction 1 # ...
- 1
- 指定使用低 worker 延迟策略。
随着更改被应用,每个 worker 节点上的调度都会被禁用。
验证
当所有节点都返回到
Ready
条件时,您可以使用以下命令查看 Kubernetes Controller Manager 以确保应用它:$ oc get KubeControllerManager -o yaml | grep -i workerlatency -A 5 -B 5
输出示例
# ... - lastTransitionTime: "2022-07-11T19:47:10Z" reason: ProfileUpdated status: "False" type: WorkerLatencyProfileProgressing - lastTransitionTime: "2022-07-11T19:47:10Z" 1 message: all static pod revision(s) have updated latency profile reason: ProfileUpdated status: "True" type: WorkerLatencyProfileComplete - lastTransitionTime: "2022-07-11T19:20:11Z" reason: AsExpected status: "False" type: WorkerLatencyProfileDegraded - lastTransitionTime: "2022-07-11T19:20:36Z" status: "False" # ...
- 1
- 指定配置集被应用并激活。
要将中配置集改为默认,或将默认改为中,编辑 node.config
对象,并将 spec.workerLatencyProfile
参数设置为适当的值。