How to listen or watch pod ip change event history in kubernetes?

490 Views Asked by At

I want to save the history pod ip changes for troubleshooting in future. How can i do that ? Is there api in k8s io.fabric client i can use?

1

There are 1 best solutions below

0
On BEST ANSWER

You can watch on endpoints and not pods itself.

Eg.

 try (Watch watch = client.endpoints().inNamespace(namespace).watch(new Watcher<Endpoints>() {
        @Override
        public void eventReceived(Action action, Endpoints resource) {
        ....//your code
         }
     ....