2.4. 配置 Fuse Online pod
您可以通过在 Fuse Online 自定义资源中设置节点关联性和容限选项,配置 Fuse Online 基础架构组件和集成 pod 放置到 OpenShift 集群的节点上。nodeAffinity
选项允许您指定 Fuse Online pod 的关联性和要放置的一组节点。tolerations
选项允许您控制在哪些节点上运行 Fuse Online pod 的节点,并防止其他工作负载使用这些节点。
您可以通过在安装 Fuse Online 之前或安装后编辑 Fuse Online 自定义资源来设置这些选项。
您可以指定与集成部署分开的基础架构组件部署配置节点关联性或容限设置:
infraScheduling
- 指定infraScheduling
选项,为这些 Fuse 在线基础架构部署配置节点关联性和容限设置:-
syndesis-db
-
syndesis-meta
-
syndesis-prometheus
syndesis-ui
注 :
syndsis-operator
部署不受节点关联性或容限更改的影响,因为它是 Fuse 在线管理组件。
-
integrationScheduling
- 指定integrationScheduling
选项,为所有 Fuse 在线集成部署配置节点关联性和容限设置。注意 :如果要知道 Fuse Online 部署是否为集成部署,请检查部署名称。您可以使用
oc get pods
命令来查看正在运行的部署列表。如果部署名称包含-i
前缀,它是一个集成部署,例如i-my-integration
。
以下流程描述了如何使用 oc patch
命令编辑自定义资源。另外,您可以按照这些主题中所述编辑自定义资源:
- 如果您已经安装了 Fuse Online,请按照"更改 Fuse Online 配置" 中的步骤打开自定义资源。
如果您尚未安装 Fuse Online,按照这些主题中的步骤打开自定义资源,具体取决于您的 OCP 版本。
- 对于 OCP 4.x: 将 Fuse Online 实例添加到 OpenShift 4.x 项目
先决条件
- Fuse Online 已安装在 OCP on-site.
-
已安装
oc
客户端工具,它连接到安装了 Fuse Online 的 OCP 集群。
流程
使用
oc patch
命令,并使用以下语法配置 容限 设置。为 Fuse Online infrastructure 组件部署指定infra
部署指定 IntegrationScheduling:Scheduling
,或为 Fuse Online 集成oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling"|"infraScheduling":{"tolerations":[{"key":"_value1_","operator":"_value2_","effect":"_value3_"},{"key":"_value4_","operator":"_value5_","effect":"_value6_"}]}}}'
oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling"|"infraScheduling":{"tolerations":[{"key":"_value1_","operator":"_value2_","effect":"_value3_"},{"key":"_value4_","operator":"_value5_","effect":"_value6_"}]}}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 例如,以下命令为 Fuse 在线基础架构组件添加了容限:
oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling":{"tolerations":[{"key":"tol_1","operator":"Equal","effect":"NoSchedule"},{"key":"tol_2","operator":"Equal","value":"value2","effect":"NoSchedule"}]}}}'
oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling":{"tolerations":[{"key":"tol_1","operator":"Equal","effect":"NoSchedule"},{"key":"tol_2","operator":"Equal","value":"value2","effect":"NoSchedule"}]}}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用带有以下语法的
oc patch
命令配置 节点关联性 设置。为 Fuse Online infrastructure 组件部署指定infra
部署指定 IntegrationScheduling:Scheduling
,或为 Fuse Online 集成oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling"|"infraScheduling":{"affinity":{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":_value1_,"preference":{"matchExpressions":[{"key":"_value1_","operator":"_value2_","values":["_value3_","_value4_"]}]}}]}}}'
oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling"|"infraScheduling":{"affinity":{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":_value1_,"preference":{"matchExpressions":[{"key":"_value1_","operator":"_value2_","values":["_value3_","_value4_"]}]}}]}}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 例如,以下命令将 nodeAffinity 设置为 Fuse Online 基础架构组件和集成:
oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling":{"affinity":{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":11,"preference":{"matchExpressions":[{"key":"_affinity","operator":"In","values":["foo","bar"]}]}}]}}},"integrationScheduling":{"affinity":{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":22,"preference":{"matchExpressions":[{"key":"my_affinity2","operator":"In","values":["foo","bar"]}]}}]}}}}}'
oc patch syndesis/app --type=merge -p '{"spec":{"infraScheduling":{"affinity":{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":11,"preference":{"matchExpressions":[{"key":"_affinity","operator":"In","values":["foo","bar"]}]}}]}}},"integrationScheduling":{"affinity":{"nodeAffinity":{"preferredDuringSchedulingIgnoredDuringExecution":[{"weight":22,"preference":{"matchExpressions":[{"key":"my_affinity2","operator":"In","values":["foo","bar"]}]}}]}}}}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 要删除配置设置,请在
oc patch
命令中使用remove
选项,如下例所示:以下示例命令从 Fuse 在线集成中的 nodeAffinity 中删除
preferredDuringSchedulingIgnoredDuringExecution
设置:oc patch syndesis/app --type=json -p '[{"op": "remove", "path": "/spec/integrationScheduling/affinity/nodeAffinity/preferredDuringSchedulingIgnoredDuringExecution" }]'
oc patch syndesis/app --type=json -p '[{"op": "remove", "path": "/spec/integrationScheduling/affinity/nodeAffinity/preferredDuringSchedulingIgnoredDuringExecution" }]'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 以下示例从 Fuse Online 基础架构组件中删除容限:
oc patch syndesis/app --type=json -p '[{"op": "remove", "path": "/spec/infraScheduling/tolerations" }]'
oc patch syndesis/app --type=json -p '[{"op": "remove", "path": "/spec/infraScheduling/tolerations" }]'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
其他资源
如需有关容限和节点关联性的信息,请参阅了解节点关联性以及使用 OpenShift 文档中的 节点污点部分控制 pod 放置。