12.2. ワーカーレイテンシープロファイルの使用
ワーカーレイテンシープロファイルを実装してネットワークレイテンシーに対応するには、node.config オブジェクトを編集してプロファイルの名前を追加します。レイテンシーが増減すると、プロファイルをいつでも変更できます。
ワーカーレイテンシープロファイルは、一度に 1 つ移動する必要があります。たとえば、Default プロファイルから LowUpdateSlowReaction ワーカーレイテンシープロファイルに直接移動することはできません。最初に default のワーカーレイテンシープロファイルから MediumUpdateAverageReaction プロファイルに移動し、次に LowUpdateSlowReaction に移動する必要があります。同様に、デフォルトプロファイルに戻るときは、最初にロープロファイルからミディアムプロファイルに移動してから、デフォルトに移動する必要があります。
OpenShift Container Platform クラスターのインストール時にワーカーレイテンシープロファイルを設定することもできます。
手順
デフォルトのワーカーレイテンシープロファイルから移動するには、以下を実行します。
中規模のワーカーのレイテンシープロファイルに移動します。
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
- 中規模のワーカーレイテンシーポリシーを指定します。
変更が適用されると、各ワーカーノードでのスケジューリングは無効になります。
必要に応じて、ワーカーのレイテンシーが低いプロファイルに移動します。
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
- ワーカーの低レイテンシーポリシーの使用を指定します。
変更が適用されると、各ワーカーノードでのスケジューリングは無効になります。
検証
全ノードが
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 パラメーターを適切な値に設定します。