为 Monitoring 规划 Infra 节点

概述

为 Monitoring 插件规划并配置 infra 节点。使用插件配置将 Monitoring 工作负载放置到 infra 节点上,而不是在安装后对生成的工作负载进行 patch。

支持的配置方式

  • 对于 ACP Monitoring with Prometheus,可在控制台中通过 Advanced Configuration 进行配置,也可在 YAML 中通过 Installation 里的 spec.config.components.nodeSelectorspec.config.components.tolerations 进行配置。
  • 对于 ACP Monitoring with VictoriaMetrics,可在控制台中通过 Advanced Configuration 进行配置,也可在 YAML 中通过 Installation 里的 spec.config.components.nodeSelectorspec.config.components.tolerations 进行配置。

不要将对生成的 Deployments、StatefulSets 或其他由插件管理的工作负载进行 patch 作为将 Monitoring 工作负载放置到 infra 节点上的标准方式。

配置放置规则前

在配置放置规则之前,请确保满足以下条件:

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

在控制台中配置放置规则

Prometheus

从控制台安装或升级 ACP Monitoring with Prometheus 时,展开 Advanced Configuration 并配置以下字段:

控制台字段说明
Node Selectors为 Prometheus 工作负载设置插件级 node selector 规则。
Node Tolerations为 Prometheus 工作负载设置插件级 toleration 规则。

VictoriaMetrics

从控制台安装或升级 ACP Monitoring with VictoriaMetrics 时,展开 Advanced Configuration 并配置以下字段:

控制台字段说明
Node Selectors为 VictoriaMetrics 工作负载设置插件级 node selector 规则。
Node Tolerations为 VictoriaMetrics 工作负载设置插件级 toleration 规则。

在 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.typeLocalVolume 时,你可以选择一个或多个节点。请确保每个所选的存储节点也都匹配已配置的 node selector 规则。

故障排查

Monitoring 工作负载仍然调度到通用节点上

检查以下项:

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

Monitoring 工作负载无法调度到所选的 infra 节点上

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

常见原因:

  • infra 节点没有 nodeSelector 引用的标签。
  • infra 节点存在未被已配置 tolerations 覆盖的 taints。
  • 所选的 LocalVolume 节点或 PV nodeAffinity 规则指向了 infra 节点组之外的节点。

了解更多

后续操作

  • 验证 Monitoring 工作负载是否运行在预期的 infra 节点上。
  • 评估所选的 infra 节点是否仍然满足容量规划目标。