How to get which pod that the client is using in my loadbalancer?

9/21/2020

I deployed a kubernetes cluster and using 3 replicas for my backend NodeJS.

I am now applying some socket function and want to make sure my redis pub and sub function is working from different pod.

Therefore, I want to display the NodeJS pod name on client side to test whether is working.

*and I am using ReactJS as my frontend (client side)

-- potato
kubernetes
kubernetes-pod
node.js
redis
sockets

1 Answer

9/21/2020

The server pod would have to put that in a header or otherwise purposefully send it down to the client.

-- coderanger
Source: StackOverflow