Can I know the namespace of my k8s Pod only by looking at its IP?

15 views Asked by At

I have a list of ips of pods in a k8s cluster. I want to check what pods are from my namespace, without doing the following:

  • Getting all pods from my namespace using kubectl
  • Describing each pod to get its ip
  • Checking using O(n^2) if each ip from the list if one of the ips in the namespace

Any ideas what can I do?

I didn’t try doing it yet, from my experience it is possible but it will be long.

0

There are 0 answers