规划用于 Monitoring 的基础设施节点

概述

本文档介绍如何为 Monitoring 插件规划和配置基础设施节点。使用插件配置可将 Monitoring 工作负载放置在基础设施节点上,而不是在安装后修补生成的工作负载。

支持的配置方法

  • 对于 ACP Basic Monitoring(之前称为 ACP Monitoring for Prometheus),可以通过控制台中的 Advanced Configuration 配置放置,也可以在 Installation 中通过 YAML 配置 spec.config.components.nodeSelector 和 spec.config.components.tolerations。
  • 对于 ACP Advanced Monitoring(之前称为 ACP Monitoring for VictoriaMetrics),可以通过控制台中的 Advanced Configuration 配置放置,也可以在 Installation 中通过 YAML 配置 spec.config.components.nodeSelector 和 spec.config.components.tolerations。

不要将修补生成的 Deployments、StatefulSets 或其他由插件管理的工作负载作为将 Monitoring 工作负载放置到基础设施节点上的标准方法。

配置放置前

配置放置前,请确保满足以下条件:

  • 根据 Cluster Node Planning 规划基础设施节点。
  • 确认您的存储使用 LocalVolume,或使用带有 spec.nodeAffinity 的其他持久卷。
  • 确保所选基础设施节点同时满足调度规则和存储放置约束。

在控制台中配置放置

Prometheus

从控制台安装或升级 ACP Basic Monitoring(之前称为 ACP Monitoring for Prometheus)时,展开 Advanced Configuration 并配置以下字段:

控制台字段描述
Node Selectors为 Prometheus 工作负载设置插件级别的节点选择器规则。
Node Tolerations为 Prometheus 工作负载设置插件级别的容忍度规则。

VictoriaMetrics

从控制台安装或升级 ACP Advanced Monitoring(之前称为 ACP Monitoring for VictoriaMetrics)时,展开 Advanced Configuration 并配置以下字段:

控制台字段描述
Node Selectors为 VictoriaMetrics 工作负载设置插件级别的节点选择器规则。
Node Tolerations为 VictoriaMetrics 工作负载设置插件级别的容忍度规则。

在 YAML 中配置放置

Prometheus

如果希望 Prometheus 插件工作负载运行在专用 infra 节点上,请在安装或升级期间配置插件级别的调度规则。

示例:

spec:
  config:
    components:
      nodeSelector:
        - key: kubernetes.io/os
          value: linux
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists

VictoriaMetrics

如果希望 VictoriaMetrics 插件工作负载运行在专用 infra 节点上,请在安装或升级期间配置插件级别的调度规则。

示例:

spec:
  config:
    components:
      nodeSelector:
        - key: kubernetes.io/os
          value: linux
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/infra
          operator: Exists

当 storage.type 为 LocalVolume 时,可以选择一个或多个节点。请确保每个选定的存储节点也符合配置的节点选择器规则。

故障排查

监控工作负载仍调度在通用节点上

请检查以下项目:

  • 目标节点具有预期的标签。
  • 配置的容忍度与 infra 节点上的污点匹配。
  • 插件已使用最新的调度配置升级或重新应用。

监控工作负载无法调度到选定的 infra 节点上

此问题通常表示选定的节点不满足一项或多项调度或存储约束。

常见原因:

  • infra 节点不具有 nodeSelector 引用的标签。
  • infra 节点具有配置的容忍度未涵盖的污点。
  • 选定的 LocalVolume 节点或 PV nodeAffinity 规则指向 infra 节点组之外的节点。

了解更多

后续操作

  • 确认 Monitoring 工作负载正在预期的 infra 节点上运行。
  • 检查选定的 infra 节点是否仍符合容量规划目标。