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

field kubernetes_sd_configs not found in type config.plain #5053

Closed
quanvuminh opened this Issue Jan 2, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@quanvuminh
Copy link

quanvuminh commented Jan 2, 2019

Bug Report

What did you do?

Tried to use Kubernetes SD with Prometheus outside of the K8s cluster
What did you expect to see?

It works!

What did you see instead? Under which circumstances?

promtool failed to parse configuration

Environment

  • System information:

    Linux 4.9.0-6-amd64 x86_64

  • Prometheus version:

    prometheus, version 2.3.2+ds (branch: debian/sid, revision: 2.3.2+ds-1~bpo9+1)
    build user: pkg-go-maintainers@lists.alioth.debian.org
    build date: 20180805-18:46:45
    go version: go1.10.3

  • Prometheus configuration file:

scrape_configs:
- job_name: kubernetes-nodes
  kubernetes_sd_configs:
  - api_server: https://apiserver:6443
    role: node
    tls_config:
      ca_file: "/etc/kubernetes/pki/ca.crt"
      cert_file: "/etc/kubernetes/pki/apiserver-prometheus-client.crt"
      key_file: "/etc/kubernetes/pki/apiserver-prometheus-client.key"
      insecure_skip_verify: true
  relabel_configs:
  - action: labelmap
    regex: __meta_kubernetes_node_label_(.+)
  - target_label: __address__
    replacement: apiserver:6443
  - source_labels:
    - __meta_kubernetes_node_name
    regex: (.+)
    target_label: __metrics_path__
    replacement: /api/v1/nodes/${1}/proxy/metrics
  scheme: https
  tls_config:
    ca_file: "/etc/kubernetes/pki/ca.crt"
    cert_file: "/etc/kubernetes/pki/apiserver-prometheus-client.crt"
    key_file: "/etc/kubernetes/pki/apiserver-prometheus-client.key"
    insecure_skip_verify: true
  • Logs:
# promtool check config /etc/prometheus/prometheus.yml.k8s
Checking /etc/prometheus/prometheus.yml.k8s
  FAILED: parsing YAML file /etc/prometheus/prometheus.yml.k8s: yaml: unmarshal errors:
  line 3: field kubernetes_sd_configs not found in type config.plain
@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Jan 2, 2019

You're using the Debian package which doesn't support the Kubernetes service discovery (see here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.