Is it possible kubernetes sends a request to all pods behind a Service/ReplicaSet?

4/4/2018

I would like kubernetes when i'm sending a request to a Service which response is 204 would be send to all the pods in the ReplicaSet and not only one.

For example GET to http://srvaxivln090:30000/hotel/start This will start a service to start consume messages from a jms-queue.

I have a 3 ReplicaSet and when sending the request only one POD starts to consume the messages from the queue (the one taht receives the request)

How can i configure kubernetes that for certain requests/rules the request will be send to all the pods ?

Thank you

-- Fernando Guardiola
kubernetes

2 Answers

8/8/2018

This was asked for as a feature and then denied.

However, kubectl get endpoints <your-service> provides a list of IPs that you can use to route to each of the pods. You can build a little something that does this (you probably want -o json) and mirrors the requests across each of them.

-- Xiong Chiamiov
Source: StackOverflow

4/4/2018

I didnt try, but maybe using the ingress controller

-- Onur Yartaşı
Source: StackOverflow