We are running Prometheus on our cloud under Kubernetes, and are able to get stats back for the memory, CPU usage etc of the nodes. Now we want to be able to scrape our own custom time series from pods running on the cloud. As I understand it, this requires a job with a kubernetes_sd_config of role 'pod' (and a relabel that will select only pods with a given name). So far so good. However, from the docs I read:
The pod role discovers all pods and exposes their containers as targets. For each declared port of a container, a single target is generated. If a container has no specified ports, a port-free target per container is created for manually adding a port via relabeling.
So each pod must declare a port (in its k8s yaml, presumably?) otherwise it comes up port-free. In which case how would I ensure that each pod has a unique port number? (and if I didn't, it would presumably fail if two pods were started on the same node)