prometheus/prometheus

kubernetes-sd: expose status.PodIPs / podMonitor support IP family

Open

#14,363 opened on Jun 28, 2024

View on GitHub
 (10 comments) (1 reaction) (1 assignee)Go (64,042 stars) (10,408 forks)batch import
component/service discoverycomponent/service discovery/kuberneteshelp wanted

Description

Proposal

It would be great if the kubernetes SD can expose the status.podIPs field as well as the status.podIP.

It is quite useful in dual-stack environments where the status.podIP (the first/primary IP address of the pod) has to remain IPv4 to avoid any issues with readiness and liveness checks but the monitoring for some pods using a PodMonitor already can be migrated to IPv6. Now the PodMonitor picks the status.podIP and there is no way to change that so we will learn if the monitoring works on IPv6 when we switch to IPv6 primary in the whole cluster.

The best would be if this can be configured in the podMonitor like ipFamilies in the Service or something but only if the label is exposed then a relabel configuration can be used to change the __address__ which is also sufficient.

Contributor guide