K8s Node routing

11/22/2018

We are currently building a k8s instance in AWS. We have a specific user case where we need to route traffic to a specific service on a specific node.

We have managed to get the routing to the sevrice working using ingress rules but we cannot ensure the node. The nodes are create by AWS scaling so the ingress rules would be very dynamic.

It is worth pointing out we are running a daemon set with the service installed on each node.

Our urls look like

ServiceX.NodeX.Domain.com

And our AWS ELB is routing traffic to the specific ec2 instance but then the k8s loadbalancer is doing round robin.

-- Thomas Harris
amazon-web-services
autoscaling
kubernetes

1 Answer

11/23/2018

You can use nodeport instead of ingress and loadbalancer , and use a Sticky Sessions configuration in ELB (I use HAproxy instead) in front of nodes to handle stateful requests.

-- Nima Hashemi
Source: StackOverflow