누군가가 K8에 대한 자동 검색 구성을 안내 할 수 있습니까? Prometheus 서버가 클러스터 외부에 있습니다. 나는 Service Discovery With Kubernetes이 discussionPrometheus 자동 검색 K8s
에 언급 된 사람을 나는 아직 여기에 모든 세부 사항을 설명하기에 충분한 K8S 전문가가 아니지만, 근본적으로는 클러스터 외부 프로 메테우스를 실행하는 완벽하게 가능 (사물에 필요한 노력 중복 크로스 클러스터처럼 메타 모니터링). Cf.
in_cluster
구성 옵션은 http://prometheus.io/docs/operating/configuration/#kubernetes-sd-configurations-kubernetes_sd_config 입니다. 밖에 나가면 인증서 고리를 뛰어 넘을 필요가 있습니다.
그래서, sample configuration에서 unknown fields in kubernetes_sd_config: api_servers, in_cluster, retry_interval"
얻기 간단한 구성
- job_name: 'kubernetes'
kubernetes_sd_configs:
-
# The API server addresses. In a cluster this will normally be
# `https://kubernetes.default.svc`. Supports multiple HA API servers.
api_servers:
- https://xxx.xx.xx.xx
# Run in cluster. This will use the automounted CA certificate and bearer
# token file at /var/run/secrets/kubernetes.io/serviceaccount/ in the pod.
in_cluster: false
# Optional HTTP basic authentication information.
basic_auth:
username: prometheus
password: secret
# Retry interval between watches if they disconnect.
retry_interval: 5s
또는 다른 들여 쓰기 오류
을했다, 그들은 ca_file:
을 언급했다. K8s에서 인증서 파일을 얻는 방법 또는 K8을 지정하는 방법이 있습니까
어떤 프로 메테우스 버전을 사용하고 있습니까? 유사합니다 https://github.com/prometheus/prometheus/issues/2147 – fiunchinho