监控组件作为可观测性模块中监控、告警、巡检和健康检查功能的基础设施。本文档介绍如何在集群内安装 ACP Monitoring with Prometheus 插件或 ACP Monitoring with VictoriaMetrics 插件。
在安装监控组件前,请确保满足以下条件:
global
集群可以访问业务集群的 11780 端口。进入 App Store Management > Cluster Plugins,选择目标集群。
找到 ACP Monitoring with Prometheus 插件,点击 Install。
配置以下参数:
参数 | 说明 |
---|---|
Scale Configuration | 支持三种配置:Small Scale、Medium Scale 和 Large Scale: - 默认值基于平台推荐的负载测试值设置 - 可根据实际集群规模选择或自定义配额 - 默认值会随平台版本更新,固定配置建议自定义设置 |
Storage Type | - LocalVolume:本地存储,数据存放于指定节点 - StorageClass:通过存储类自动生成持久卷 - PV:使用已有持久卷 注意:安装后不可修改存储配置 |
Replica Count | 设置监控组件 Pod 数量 注意:Prometheus 仅支持单节点安装 |
Parameter Configuration | 可根据需要调整监控组件的数据参数 |
点击 Install 完成安装。
安装完成后,可通过以下地址访问组件(<>
替换为实际值):
组件 | 访问地址 |
---|---|
Thanos | <platform_access_address>/clusters/<cluster>/prometheus |
Prometheus | <platform_access_address>/clusters/<cluster>/prometheus-0 |
Alertmanager | <platform_access_address>/clusters/<cluster>/alertmanager |
确认插件已发布,可在 global
集群中检查 ModulePlugin 和 ModuleConfig 资源:
表示集群中存在 ModulePlugin prometheus
,且版本 v4.1.0
已发布。
创建 ModuleInfo 资源以安装插件,示例无配置参数:
资源设置参考示例 prometheus:
更多详情请参考监控组件容量规划
YAML 字段参考(VictoriaMetrics):
字段路径 | 说明 |
---|---|
metadata.labels.cpaas.io/cluster-name | 插件安装的目标集群名称。 |
metadata.labels.cpaas.io/module-name | 必须为 victoriametrics 。 |
metadata.labels.cpaas.io/module-type | 必须为 plugin 。 |
metadata.name | ModuleInfo 名称(如 <cluster>-victoriametrics )。 |
spec.version | 要安装的插件版本。 |
spec.config.storage.type | 存储类型:LocalVolume 、StorageClass 或 PV 。 |
spec.config.storage.capacity | VictoriaMetrics 存储大小(Gi),建议至少 30 Gi。 |
spec.config.storage.nodes | 当 storage.type=LocalVolume 时的节点列表,最多支持 1 个节点。 |
spec.config.storage.path | 当 storage.type=LocalVolume 时的本地路径。 |
spec.config.storage.storageClass | 当 storage.type=StorageClass 时的存储类名称。 |
spec.config.storage.pvSelectorK | 当 storage.type=PV 时的 PV 选择器键。 |
spec.config.storage.pvSelectorV | 当 storage.type=PV 时的 PV 选择器值。 |
spec.replicas | 副本数;LocalVolume 不支持多副本。 |
spec.config.components.vmstorage.retention | vmstorage 的数据保留天数。 |
spec.config.components.vmagent.scrapeInterval | 抓取间隔秒数;适用于无 interval 的 ServiceMonitors。 |
spec.config.components.vmagent.scrapeTimeout | 抓取超时秒数,必须小于 scrapeInterval 。 |
spec.config.components.vmstorage.resources | vmstorage 的资源配置。 |
spec.config.components.nodeExporter.port | Node Exporter 端口(默认 9100)。 |
spec.config.components.nodeExporter.resources | Node Exporter 的资源配置。 |
spec.config.components.alertmanager.resources | Alertmanager 的资源配置。 |
spec.config.components.kubeStateExporter.resources | Kube State Exporter 的资源配置。 |
spec.config.components.prometheusAdapter.resources | Prometheus Adapter 的资源配置。 |
spec.config.components.vmagent.resources | vmagent 的资源配置。 |
spec.config.size | 监控规模:Small 、Medium 或 Large 。 |
由于创建后 ModuleInfo 名称会变化,可通过标签定位资源,查看插件状态和版本:
字段说明:
NAME
:ModuleInfo 资源名称CLUSTER
:插件安装的集群MODULE
:插件名称DISPLAY_NAME
:插件显示名称STATUS
:安装状态,Running
表示安装成功且运行中TARGET_VERSION
:预期安装版本CURRENT_VERSION
:安装前版本NEW_VERSION
:可安装的最新版本进入 App Store Management > Cluster Plugins,选择目标集群。
找到 ACP Monitoring with VictoriaMetrics 插件,点击 Install。
配置以下参数:
参数 | 说明 |
---|---|
Scale Configuration | 支持三种配置:Small Scale、Medium Scale 和 Large Scale: - 默认值基于平台推荐的负载测试值设置 - 可根据实际集群规模选择或自定义配额 - 默认值会随平台版本更新,固定配置建议自定义设置 |
Install Agent Only | - 关闭:安装完整 VictoriaMetrics 组件套件 - 开启:仅安装 VMAgent 采集组件,依赖 VictoriaMetrics Center |
VictoriaMetrics Center | 选择已安装完整 VictoriaMetrics 组件的集群 |
Storage Type | - LocalVolume:本地存储,数据存放于指定节点 - StorageClass:通过存储类自动生成持久卷 - PV:使用已有持久卷 |
Replica Count | 设置监控组件 Pod 数量: - LocalVolume 存储类型不支持多副本 - 其他存储类型请参考界面提示配置 |
Parameter Configuration | 可调整监控组件的数据参数 注意:数据可能会暂时超出保留期后再删除 |
点击 Install 完成安装。
确认插件已发布,可在 global
集群中检查 ModulePlugin 和 ModuleConfig 资源:
表示集群中存在 ModulePlugin victoriametrics
,且版本 v4.1.0
已发布。
创建 ModuleInfo 资源以安装插件,示例无配置参数:
资源设置参考示例 prometheus:
更多详情请参考监控组件容量规划
YAML 字段参考(Prometheus):
字段路径 | 说明 |
---|---|
metadata.labels.cpaas.io/cluster-name | 插件安装的目标集群名称。 |
metadata.labels.cpaas.io/module-name | 必须为 prometheus 。 |
metadata.labels.cpaas.io/module-type | 必须为 plugin 。 |
metadata.name | ModuleInfo 名称(如 <cluster>-prometheus )。 |
spec.version | 要安装的插件版本。 |
spec.config.storage.type | 存储类型:LocalVolume 、StorageClass 或 PV 。 |
spec.config.storage.capacity | Prometheus 存储大小(Gi),建议至少 30 Gi。 |
spec.config.storage.nodes | 当 storage.type=LocalVolume 时的节点列表,最多支持 1 个节点。 |
spec.config.storage.path | 当 storage.type=LocalVolume 时的本地路径。 |
spec.config.storage.storageClass | 当 storage.type=StorageClass 时的存储类名称。 |
spec.config.storage.pvSelectorK | 当 storage.type=PV 时的 PV 选择器键。 |
spec.config.storage.pvSelectorV | 当 storage.type=PV 时的 PV 选择器值。 |
spec.replicas | 副本数,仅适用于 StorageClass /PV 类型。 |
spec.config.components.prometheus.retention | 数据保留天数。 |
spec.config.components.prometheus.scrapeInterval | 抓取间隔秒数;适用于无 interval 的 ServiceMonitors。 |
spec.config.components.prometheus.scrapeTimeout | 抓取超时秒数,必须小于 scrapeInterval 。 |
spec.config.components.prometheus.resources | Prometheus 的资源配置。 |
spec.config.components.nodeExporter.port | Node Exporter 端口(默认 9100)。 |
spec.config.components.nodeExporter.resources | Node Exporter 的资源配置。 |
spec.config.components.alertmanager.resources | Alertmanager 的资源配置。 |
spec.config.components.kubeStateExporter.resources | Kube State Exporter 的资源配置。 |
spec.config.components.prometheusAdapter.resources | Prometheus Adapter 的资源配置。 |
spec.config.components.thanosQuery.resources | Thanos Query 的资源配置。 |
spec.config.size | 监控规模:Small 、Medium 或 Large 。 |
由于创建后 ModuleInfo 名称会变化,可通过标签定位资源,查看插件状态和版本:
字段说明:
NAME
:ModuleInfo 资源名称CLUSTER
:插件安装的集群MODULE
:插件名称DISPLAY_NAME
:插件显示名称STATUS
:安装状态,Running
表示安装成功且运行中TARGET_VERSION
:预期安装版本CURRENT_VERSION
:安装前版本NEW_VERSION
:可安装的最新版本