I currently have a setup where I have 1 NLB in my EKS cluster. I deployed ServiceA and ServiceB and both of them use the same NLB.
However, I am curious to know whether it is possible to create more than 1 NLB in a EKS cluster?
- If yes, which use case would this be useful for?
- And how would I specify ServiceC to use NLB1 and ServiceD to use NLB2?
I did not find specific documentation surrounding this and any pointers on this would be helpful. Thanks!
It is possible.
I've never done it with NLBs but this should be as simple as deploying a second
Service
of typeLoadBalancer
with the annotation indicating it's a nlb rather than an elb.As to use case, a few that spring to mind:
Routing would be accomplished by binding the deployment manifests for service C to the Service for NLB1 and the deployment manifests of service D to NLB2. Services route to pods through selectors, so it's merely a matter of ensuring your mapping is correct.