-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix prometheus URL in prometheus-adapter #1463
Fix prometheus URL in prometheus-adapter #1463
Conversation
That check is running successfully on my laptop, how can I trigger another CI run? |
291738a
to
53e0a47
Compare
@@ -33,7 +33,7 @@ spec: | |||
- --config=/etc/adapter/config.yaml | |||
- --logtostderr=true | |||
- --metrics-relist-interval=1m | |||
- --prometheus-url=http://prometheus-k8s.monitoring.svc.cluster.local:9090/ | |||
- --prometheus-url=http://prometheus-k8s.monitoring:9090/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work without svc
in url? I would expect http://prometheus-k8s.monitoring.svc:9090/
to work correctly, but I am not sure about http://prometheus-k8s.monitoring:9090/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does. The kubelet sets the following in the pods resolv.conf
nameserver 10.32.0.10
search <namespace>.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#namespaces-of-services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://prometheus-k8s.monitoring.svc:9090/
also works, I can update the PR if you want it that way.
53e0a47
to
a6442df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
If the kube-prometheus stack on a cluster with a cluster domain that is different than the default
.cluster.local
,prometheus adapter fails to connect to the prometheus server with the following error:
This would also fail if prometheus was deployed in a different namespace than the namespace specified in
$.values.common.namespace
Type of change
CHANGE
(fix or feature that would cause existing functionality to not work as expected)FEATURE
(non-breaking change which adds functionality)BUGFIX
(non-breaking change which fixes an issue)ENHANCEMENT
(non-breaking change which improves existing functionality)NONE
(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Changelog entry