<p>I'm using the kubernetes go api. I have the IP of a pod, and I want to find the v1.pod object (or just name and namespace) of the pod that has that IP. How can I go about this?</p>

Matthew Tromp
<p>Turns out you need to use a FieldSelector. The field in this case is <code>status.podIP</code>.</p>
<pre class="lang-golang prettyprint-override"><code>import (
    [...]
    metav1 &quot;k8s.io/apimachinery/pkg/apis/meta/v1&quot;
    [...]
)

[...]

pods, err := clientset.CoreV1().Pods(&quot;&quot;).List(context.Background(), metav1.ListOptions{FieldSelector: &quot;status.podIP=&quot; + address})
</code></pre>
<p>Where <code>clientset</code> is a <code>*kubernetes.Clientset</code> and <code>address</code> is the string IP of the pod</p>
