Make a request on all pods in Google Kubernetes

5/27/2020

I'm looking a way to call /test endpoint of my service on all the pods I could have (essentially I have only 3 pods).

It's is that possible?

I tried a Cloud Function that calls my balanced ip (https://10.10.10.10:1111/test) however this will send the request to only one pod i.e Pod1 therefore Pod2 and Pod3 don't execute /test and I need the request to be executed on all 3 pods.

It doesn't matter what this /test does I just need to be executed on all pods.

Any hint to achieve this would be awesome.

-- Dr3ko
google-cloud-functions
google-cloud-platform
google-kubernetes-engine
httprequest
kubernetes

1 Answer

5/27/2020

There is no specific way, you'll have to use the Kubernetes API to get all the pod IPs and make a request to each individually. This is usually a sign of some wonky software design though.

-- coderanger
Source: StackOverflow