Question

Pointing multiple domains to managed k8s cluster.

Just created my managed k8s cluster and deployed some applications. Can i somehow point a domain/subdomain to each app without setting up additional droplet with proxy(nginx for example), with just DO managed products? P.S. some apps also have more than 1 replicas, so some kind of load balancing will be needed too.


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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hey gabe!

For the load balancing, you can create a Kubernetes service [1] pointing to the deployment. Requests coming to it’s IP will automatically be distributed across all the replicas.

For the multiple domains you can:

  • Create a Kubernetes ingress [2] or simply spin up an NGINX/HAProxy deployment that will receive requests from all domains in the same IP and decide to which internal service to send.
  • Expose your ingress controller or NGINX/HAProxy deployment with a Kubernetes load balancer service [3] (which will automatically provision a DO Load Balancer [4] pointing to your nodes for you – $10/mo)
  • OR for a cheaper option, expose them using a ClusterIP with ExternalIPs… This is not recommended due to availability but is $10/mo cheaper than the other option.
  • Point your (sub)domains to the load balancer IP (or droplet IP for the second option) and set up the rules in the ingress definition/nginx or haproxy config.

That’s it :)

[1] https://kubernetes.io/docs/concepts/services-networking/service/ [2] https://kubernetes.io/docs/concepts/services-networking/ingress/ [3] https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/ [4] https://www.digitalocean.com/products/load-balancer/