This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.4.7.3. 使用容忍度来控制日志收集器 pod 放置
您可以通过在 pod 上使用容忍度来确保日志记录收集器 pod 在哪些节点上运行,并防止其他工作负载使用这些节点。
您可以通过 ClusterLogging 自定义资源(CR)将容忍度应用到日志记录收集器 pod,并通过节点规格将污点应用到节点。您可以使用污点和容限来确保 pod 不会因为内存和 CPU 问题而被驱除。
默认情况下,日志记录收集器 pod 具有以下容忍度:
tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" effect: "NoExecute"
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoExecute"
先决条件
- 必须安装 OpenShift Logging 和 Elasticsearch。
流程
使用以下命令,将污点添加到要在其上调度日志记录收集器 pod 的节点:
oc adm taint nodes <node-name> <key>=<value>:<effect>
$ oc adm taint nodes <node-name> <key>=<value>:<effect>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 例如:
oc adm taint nodes node1 collector=node:NoExecute
$ oc adm taint nodes node1 collector=node:NoExecuteCopy to Clipboard Copied! Toggle word wrap Toggle overflow 本例在
node1上放置一个键为collector且值为node的污点,污点效果是NoExecute。您必须使用NoExecute污点设置。NoExecute仅调度与污点匹配的 pod,并删除不匹配的现有 pod。编辑
ClusterLogging自定义资源(CR)的collection小节,以配置日志记录收集器 Pod 的容忍度:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
此容忍度与 oc adm taint 命令创建的污点匹配。具有此容限的 pod 可以调度到 node1 上。