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 upGet the clusterIP from service via kubernetes_sd meta label #3110
Comments
brian-brazil
added
component/service discovery
help wanted
kind/enhancement
priority/P3
hacktoberfest
labels
Sep 28, 2017
tariq1890
referenced this issue
Dec 3, 2018
Merged
expose kubernetes service cluster ip/external name #4940
brian-brazil
closed this
in
#4940
Dec 18, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
talset commentedAug 24, 2017
Environment
Kubernetes v1.5.4+coreos.0"
quay.io/prometheus/prometheus:v2.0.0-beta.0
Question
When I use
role: serviceit use by default thesvc.Name+"."+svc.Namespace+".svc"(https://github.com/prometheus/prometheus/blob/master/discovery/kubernetes/service.go#L153) as address. Since we are not using skydns in our k8s cluster we would like to use the service ip / ClusterIP directly.As the same way you get the port from spec (https://github.com/prometheus/prometheus/blob/master/discovery/kubernetes/service.go#L152), is it possible to get the clusterIP (when it is present) and export it as metalabel
__meta_kubernetes_service_clusterIPto prometheus ?