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 upkubernetes-cluster issue with 0.20.0 (malformed HTTP response) #1752
Comments
This comment has been minimized.
This comment has been minimized.
|
Looks like it's trying to scrape an https endpoint via http - you'll need to set the scheme in config to |
This comment has been minimized.
This comment has been minimized.
|
Ok, indeed, thanks, I finally have a working setup using this diff, is it intended? (changes between --- i/etc/prometheus.yml
+++ w/etc/prometheus.yml
@@ -30,6 +30,7 @@ scrape_configs:
# configuration (`in_cluster` below) because discovery & scraping are two
# separate concerns in Prometheus.
tls_config:
+ insecure_skip_verify: true
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
@@ -42,6 +43,10 @@ scrape_configs:
- source_labels: [__meta_kubernetes_role]
action: keep
regex: (?:apiserver|node)
+ - source_labels: [__scheme__]
+ action: replace
+ replacement: 'https'
+ target_label: __scheme__
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- source_labels: [__meta_kubernetes_role] |
This comment has been minimized.
This comment has been minimized.
|
Is that a diff from the example config? If so, then the dropping |
This comment has been minimized.
This comment has been minimized.
|
Hum, ok, no it's a diff from my initial post and configuration #1752 (comment) |
This comment has been minimized.
This comment has been minimized.
mgoodness
commented
Jun 24, 2016
|
I'm running into this as well. Shouldn't Prometheus be scraping the Kubelet metrics on port 10255? That is the default read-only port, and the one Heapster uses, so (at least in my case) it is exposed on all worker nodes. Port 10250, meanwhile, is the default Kubelet "control" port and is (or should be) only externally accessible by controller nodes. |
This comment has been minimized.
This comment has been minimized.
|
Can confirm, also ran into the port issue. Not sure whether it relates to the port changes we did, but it seems like a regression in general. |
This comment has been minimized.
This comment has been minimized.
|
You can of course change the port via relabelling. As I said above the relabelling of scheme to https shouldn't have been removed which is likely the cause of this issue. The read only port is not enabled by default & secure environments dont enable it, scraping over kubelet port instead. |
This comment has been minimized.
This comment has been minimized.
mgoodness
commented
Jun 24, 2016
|
I have confirmed that, using the example configuration in this repo, v0.19.3 scrapes port 10255 (the http, read-only port), while v0.20.0 scrapes port 10250 (which is https). Heapster's default configuration is also to scrape 10255. If Prometheus wants to scrape 10250, then the scheme must be relabeled to |
This comment has been minimized.
This comment has been minimized.
|
There has been discussion on removing the read only port for a while (kubernetes/kubernetes#12968) as there is potential for info leakage as no encryption, auth, etc. Port 10255 is an arbitrary port number that cannot be discovered. Adding an option for it gives no functional benefit over relabelling. As for the TLS bit, the problem is there are too many variations in cluster set up. In secure envs, the cert of the CA used to sign both the api server & kubelet certs is distributed to all pods automatically so the connection to the kubelet over discovered port can be validated. That should remain the default IMO, connecting to read only port or disabling TLS verification should be opt in with knowledge of the potential (albeit probably minimal) risks. |
This comment has been minimized.
This comment has been minimized.
|
That all makes sense to me. Thanks for the explanation. |
jimmidyson
referenced this issue
Jun 27, 2016
Merged
Kubernetes SD: Update example config with TLS options #1767
fabxc
closed this
in
#1767
Jun 27, 2016
This comment has been minimized.
This comment has been minimized.
vbasavani
commented
Feb 3, 2018
|
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |
sbadia commentedJun 17, 2016
•
edited by jimmidyson
What did you do?
Just upgraded from prometheus
0.19.3to0.20.0,I only changed
target_groups=>static_configsin myprometheus.ymlconfiguration file.What did you expect to see?
With release
0.20.0the kubernetes-sd/kubernetes-cluster doesn't works anymore (or I missed a config option…).What did you see instead? Under which circumstances?
On webui,
Targets > kubernetes-cluster > Endpointmy nodes fail with this errormalformed HTTP responsehttp://10.1.2.2:10250/metricsGet http://10.1.2.2:10250/metrics: malformed HTTP response "\x15\x03\x01\x00\x02\x02"Maybe linked to 206bcfc ?
Environment
Linux 3.16.0-4-amd64 x86_64