I have a kubernetes cluster that has many services on it. How can I make one pod publish a message, and receive it from another siblings pods (pods of the same service), using kubernetes-java-client.
Until now, I didn't find a way to do the job done.
Example: 1 Service -> 4 pod (4/4 replicaSet)
Invoke Api in the service, load balance takes the request to 1 Pod, so other pods need to do a reaction because a specific Api in another pod has been activated.
So, the pod publish an event, and other sibling pods consumes the event, an do the reaction. Or the pod communicates directly with its siblings to tell them to do the reaction.
Is this possible, and what is the right way to a similar scenario?
Other than using the Kubernetes API to discover the peer pods (usually via the endpoints API), it doesn’t provide anything in particular for the actual comms, that would be up to your code.