By rmalenko
Hello,
How I can affinity DOLB to nodes only which have a tag? I have already configured three droplets with Istio in DO Kubernetes cluster. So I would like to direct traffic from LB only to these three nodes.
Regards, Rostyslav
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Heya, @rmalenko
DigitalOcean’s cloud Load Balancer (and the type: LoadBalancer you get in DOKS) can’t target “only nodes with a given Droplet tag”. It doesn’t understand Droplet tags at the Kubernetes level, and by default, it sends traffic to the Service’s NodePort on every node in the cluster.
The usual workaround is to make sure only the nodes you want are eligible to receive traffic:
If this is for an Ingress gateway (Istio), run the gateway as a DaemonSet (or otherwise ensure it only runs on those 3 nodes using a nodeSelector / node affinity), and set the Service in front of it to externalTrafficPolicy: Local. With Local, nodes that don’t have a ready gateway pod won’t be used as backends, so the LB effectively only hits the nodes you pinned the gateway to.
If you don’t want it on every node, another clean pattern is a dedicated node pool for “ingress” (label those nodes), then pin the gateway pods to that pool (and optionally taint the pool so only gateway pods land there).
So, you can’t filter LB backends by Droplet tag directly, but you can achieve the same result by controlling where the receiving pods run + using externalTrafficPolicy: Local.
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.