9.3. 配置 pod 连接检查放置
作为集群管理员,您可以通过修改名为 cluster
的 network.config.openshift.io
对象来配置运行连接 pod 的节点。
先决条件
-
安装 OpenShift CLI (
oc
) 。
流程
要编辑连接检查配置,请输入以下命令:
$ oc edit network.config.openshift.io cluster
-
在文本编辑器中,更新
networkDiagnostics
小节,以指定您要用于源和目标 pod 的节点选择器。 - 要提交您的更改,请保存更改并退出文本编辑器。
验证
要验证源和目标 pod 是否在预期节点上运行,请输入以下命令:
$ oc get pods -n openshift-network-diagnostics -o wide
输出示例
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES network-check-source-84c69dbd6b-p8f7n 1/1 Running 0 9h 10.131.0.8 ip-10-0-40-197.us-east-2.compute.internal <none> <none> network-check-target-46pct 1/1 Running 0 9h 10.131.0.6 ip-10-0-40-197.us-east-2.compute.internal <none> <none> network-check-target-8kwgf 1/1 Running 0 9h 10.128.2.4 ip-10-0-95-74.us-east-2.compute.internal <none> <none> network-check-target-jc6n7 1/1 Running 0 9h 10.129.2.4 ip-10-0-21-151.us-east-2.compute.internal <none> <none> network-check-target-lvwnn 1/1 Running 0 9h 10.128.0.7 ip-10-0-17-129.us-east-2.compute.internal <none> <none> network-check-target-nslvj 1/1 Running 0 9h 10.130.0.7 ip-10-0-89-148.us-east-2.compute.internal <none> <none> network-check-target-z2sfx 1/1 Running 0 9h 10.129.0.4 ip-10-0-60-253.us-east-2.compute.internal <none> <none>