云容器实例 CCI-Pod资源监控指标:基础配置

时间:2023-12-21 21:07:00

基础配置

以下示例介绍Pod资源监控指标的基础配置方式,提供了Pod级别特性开关和自定义端口的能力。

kind: Deployment
apiVersion: apps/v1
metadata:
  name: nginx-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-exporter
  template:
    metadata:
      labels:
        app: nginx-exporter
      annotations:
        monitoring.cci.io/enable-pod-metrics: "true"
        monitoring.cci.io/metrics-port: "19100"
    spec:
      containers:
        - name: container-0
          image: 'nginx:alpine'
          resources:
            limits:
              cpu: 1000m
              memory: 2048Mi
            requests:
              cpu: 1000m
              memory: 2048Mi
      imagePullSecrets:
        - name: imagepull-secret
表2 参数说明

Annotation

功能

可选值

默认值

monitoring.cci.io/enable-pod-metrics

是否开启监控指标特性

true,false(不区分大小写)

true

monitoring.cci.io/metrics-port

指定pod exporter启动监听端口

合法端口(1~65535)

19100

support.huaweicloud.com/devg-cci/cci_05_1003.html