Question

LoadBalancer annotation for droplet tag selector

When you create load balancer throughout web ui, you can choose droplet tags, but I can’t find annotation for LoadBalancer to do this, example annotations:

    annotations:
      service.beta.kubernetes.io/do-loadbalancer-name: "some-name-private-lb"
      service.beta.kubernetes.io/do-loadbalancer-size-unit: "2"
      service.beta.kubernetes.io/do-loadbalancer-network: "INTERNAL"
      service.beta.kubernetes.io/do-loadbalancer-protocol: "tcp"
      service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
      service.beta.kubernetes.io/do-loadbalancer-tls-passthrough: "true"
      service.beta.kubernetes.io/do-loadbalancer-algorithm: "round_robin"

with which annotations I can achieve tags selector?


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
February 16, 2025

Hi there,

As far as I can tell from the docs, there isn’t a specific annotation to select Droplets by tag when creating a LoadBalancer service in DigitalOcean Kubernetes. The available annotations focus on configuring load balancer settings like protocol, size, and SSL certificates:

https://docs.digitalocean.com/products/kubernetes/how-to/configure-load-balancers

It sounds like you’re looking to select Droplets by tag when provisioning a LoadBalancer service in DigitalOcean Kubernetes. If I remember correctly, in DOKS, the load balancer is automatically tied to worker nodes, not individual Droplets.

Are you trying to control which worker nodes receive traffic from the load balancer? If so, you might need to use node selectors instead of tags.

If you’re looking for something more specific, DigitalOcean support might be able to provide more details: https://do.co/support.

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.