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_sd_config pod: additional instance for port 80 created #2208
Comments
This comment has been minimized.
This comment has been minimized.
|
Version In your case you probably want to use relabelling to drop or keep one or the other. What I have done and seen other people do is introduce a practice in your environment where you keep only those targets of a Pod that have a specific port name. To make a specific suggestion regarding your ReplicationController you would have to add a port to the ports list add give it the name "metrics" for example. Then in your
|
This comment has been minimized.
This comment has been minimized.
|
Ah, thank you. So if you match for Would be nice If kubernetes would allow to have the same port with different names per container, this would also work for applications which expose metrics on the same port as the service
but kubernetes only keeps one name |
baracoder
closed this
Nov 22, 2016
This comment has been minimized.
This comment has been minimized.
|
@baracoder just out of curiosity what is your use case for using the Pod discovery? I have the feeling that 98% of the cases can be achieved cleaner with the Endpoints discovery, but very curious to hear otherwise and be convinced. With Endpoints discovery you are in the position to create a second Endpoints object with the same Port definition but different name. |
This comment has been minimized.
This comment has been minimized.
|
@brancz my plan was to define the targets in the Deployment resource, since the configuration for the target is in there too and I have some pods for background work which are not exposed as services. |
This comment has been minimized.
This comment has been minimized.
|
Nice. Thanks for the insight. Do you do any relabelling to get the job label to be more precise than "kubernetes-pods"? |
This comment has been minimized.
This comment has been minimized.
|
since the pods have labels anyway, the labelmap seams enough
It seams enough now but I don't know if it will hold in the future |
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 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. |
baracoder commentedNov 18, 2016
What did you do?
create a pod with annotation
What did you expect to see?
One instance for target kubernetes-pods with URL like http://10.2.17.4:9108/metrics
What did you see instead? Under which circumstances?
Two instances, one with port 80 which I never defined
http://10.2.17.4:80/metrics
http://10.2.17.4:9108/metrics
Environment
example config from the 1.3.1 tag https://github.com/prometheus/prometheus/blob/v1.3.1/documentation/examples/prometheus-kubernetes.yml but rmoved
api_servers: ..