Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upProblems on setting up prometheus outside kubernetes cluster #3044
Comments
This comment has been minimized.
This comment has been minimized.
|
Sorry, it was just a misconfiguration combined with an trailing on the bearer token.
|
tuner23
closed this
Aug 10, 2017
This comment has been minimized.
This comment has been minimized.
chesterlai
commented
Oct 5, 2017
|
@tuner23 |
This comment has been minimized.
This comment has been minimized.
|
Hi, |
This comment has been minimized.
This comment has been minimized.
chesterlai
commented
Oct 5, 2017
|
thanks for your responding But I think it exists a problem about my setting. Could you share your prometheus configuration with me? And my token file format is which I copy the information on k8s secret "token" column directly. |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
tuner23 commentedAug 9, 2017
Hi,
i am trying to connect prometheus to a kubernetes-cluster. Prometheus is running outside the k8-cluster..
I created a bearer token, which works well when running with curl:
curl -X GET -H "Authorization: Bearer ..." https://ose-master.mgmt.tb/api/v1/services?resourceVersion=0When i start up prometheus i get the following error(s):
ERRO[0002] github.com/prometheus/prometheus/discovery/kubernetes/kubernetes.go:179: Failed to list *v1.Endpoints: User "system:anonymous" cannot list all endpoints in the cluster component="kube_client_runtime" source="kubernetes.go:75" ERRO[0002] github.com/prometheus/prometheus/discovery/kubernetes/kubernetes.go:180: Failed to list *v1.Service: User "system:anonymous" cannot list all services in the cluster component="kube_client_runtime" source="kubernetes.go:75" ERRO[0002] github.com/prometheus/prometheus/discovery/kubernetes/kubernetes.go:181: Failed to list *v1.Pod: User "system:anonymous" cannot list all pods in the cluster component="kube_client_runtime" source="kubernetes.go:75"I also tried to inclube the bearer token in kubernetes_sd_configs with no difference.
Is that a problem in connecting ose-kubernetes with prometheus, or am i doing something wrong (since the request works well with curl)
Environment
Linux 3.10.0-514.21.2.el7.x86_64 x86_64
prometheus, version 1.7.1 (branch: master, revision: 3afb3ff)
build user: root@0aa1b7fc430d
build date: 20170612-11:44:05
go version: go1.8.3
scrape_configs:
scrape_interval: 5s
static_configs:
kubernetes_sd_configs:
api_server: 'https://ose-master.mgmt.tb'
scheme: https
tls_config:
server_name: ose-master.mgmt.tb.noris.de
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
relabel_configs:
action: keep
regex: default;kubernetes;https
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
api_server: 'https://ose-master.mgmt.tb'
relabel_configs:
regex: _meta_kubernetes_node_label(.+)
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
kubernetes_sd_configs:
api_server: 'https://ose-master.mgmt.tb'
relabel_configs:
action: keep
regex: true
action: replace
target_label: scheme
regex: (https?)
action: replace
target_label: metrics_path
regex: (.+)
action: replace
target_label: address
regex: (.+)(?::\d+);(\d+)
replacement: $1:$2
action: replace
target_label: basic_auth_username
regex: (.+)
action: replace
target_label: basic_auth_password
regex: (.+)
regex: _meta_kubernetes_service_label(.+)
action: replace
target_label: kubernetes_namespace
action: replace
target_label: kubernetes_name