My backend has 5 different deployments, each serving the request in a specific port.
Frontend service contacts the backend service with the necessary details. The backend service should be able to decide the required pod (from one of the 5 deployments) to serve the request.
Instead of creating 5 different services, is it possible to link a single service to multiple deployments?
Kubernetes version: 1.12
Cloud being used: Amazon EKS
Services use selectors and labels to target pods. If all your pods have the same label and the service targets that label; they will be included in that service.
With that said – you won’t be able to map specific ports to specific pods and it’s likely the application level routing will fail. A service will load-balance across all pods in the service and you won’t be able to do more granular routing.
You might want to take a look at some of the service mesh offerings like linkerd and istio that can do more granular control like that.
Very well described situations by @mrbobbytables , You need to do away with VM based EKS. For better management either you need to get those service mesh or you need to switch to native container based cloud which will provide deep granularity also your devops will be much simpler.
P.S - I was on AWS an year back and had shift away due to many advance issue in devops, including this one.
I’m trying to implement istio for service mesh. Basically, I’m planning to introduce a VirtualService on top of 5 different backend services (in my actual question) and to access it from the Frontend service.
Is it possible to expose istio’s VirtualService to kubernetes’ Service?
Or should I include the frontend service also inside the VirtualService along with the Gateway?
I’m trying to implement istio for service mesh. Basically, I’m planning to introduce a VirtualService on top of 5 different backend services (in my actual question) and to access it from the Frontend service.
Is it possible to expose istio’s VirtualService to kubernetes’ Service?
I don’t quite understand the question. Typically a VirtualService represents a hostname (HTTP host header) or IP address to which your custom processing applies (e.g. URL Path matching). Any client who is sidecar-enabled and ties to access that hostname or IP should automatically be routed through that custom processing.