Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cvimer opened this issue Jul 28, 2022 · 1 comment
Open

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

cvimer opened this issue Jul 28, 2022 · 1 comment

Comments

@cvimer
Copy link

cvimer commented Jul 28, 2022

场景:

  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

@cvimer
Copy link
Author

cvimer commented Jul 29, 2022

忽略,配置问题,已测试通过

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant