2.4. 选择指标集合配置集


要为 OpenShift Container Platform 核心监控组件选择指标集合配置集,请编辑 cluster-monitoring-config ConfigMap 对象。

先决条件

  • 已安装 OpenShift CLI(oc)。
  • 您已创建 cluster-monitoring-config ConfigMap 对象。
  • 您可以使用具有 cluster-admin 集群角色的用户身份访问集群。

流程

  1. 编辑 openshift-monitoring 项目中的 cluster-monitoring-config ConfigMap 对象:

    $ oc -n openshift-monitoring edit configmap cluster-monitoring-config
  2. data/config.yaml/prometheusK8s 下添加 metrics collection 配置集设置:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: cluster-monitoring-config
      namespace: openshift-monitoring
    data:
      config.yaml: |
        prometheusK8s:
          collectionProfile: <metrics_collection_profile_name> 
    1
    1
    指标集合配置集的名称。可用值为 fullminimal。如果没有指定值,或者配置映射中不存在 collectionProfile 键名称,则会使用 full 的默认设置。

    以下示例将 Prometheus 核心平台实例的指标集合配置集设置为 minimal

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: cluster-monitoring-config
      namespace: openshift-monitoring
    data:
      config.yaml: |
        prometheusK8s:
          collectionProfile: minimal
  3. 保存文件以使改变生效。新的配置会被自动应用。
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部