Skip to content

使用Kvass+Prometheus监控多个K8S集群集时不支持 #104

Description

@cvimer

场景:

  1. 统一的监控集群,infra
  2. 多个业务集群,test/a/b
  3. infra集群中的kvass+prometheus监控其他集群

结果:

  1. 原配置文件
    - job_name: 'cluster-test/kube-state-metrics/0'
      kubernetes_sd_configs:
        - role: endpoints
          namespaces:
            names:
              - obser
          api_server: https://172.16.36.151:6443
          tls_config:
            ca_file: /etc/prometheus/tls/cluster-test-ca.crt
          bearer_token_file: /etc/prometheus/tls/cluster-test-token
      tls_config:
        ca_file: /etc/prometheus/tls/cluster-test-ca.crt
      bearer_token_file: /etc/prometheus/tls/cluster-test-token
      relabel_configs:
        ...
  1. 生成配置文件
- job_name: cluster-test/kube-state-metrics/0
  honor_timestamps: true
  scrape_interval: 15s
  scrape_timeout: 10s
  metrics_path: /metrics
  scheme: http
  authorization:
    type: Bearer
    credentials_file: /etc/prometheus/tls/cluster-test-token
  proxy_url: http://127.0.0.1:8008
  follow_redirects: true
  relabel_configs:
  - separator: ;
    regex: __invalid_label_(.+)
    replacement: $1
    action: labelmap

kvass并没有将外部的k8s监控起来,没有生成静态配置
如果是只监控本集群内部,配置是正确生成了的,但是外部集群的静态target未生成,
如果我单独使用Prometheus是无问题的

Monosnap Prometheus Time Series Collection and Processing Server 2022-07-28 15-05-55

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions