Report this

What is the reason for this report?

Unable to figure out how to put load balancer's IP under https

Posted on May 6, 2020

So I was playing with load balancers today, I created one through kubernetes config shown further down. This Load Balancer works correctly, I can access my kubernetes cluster, however I can only do so via http://[my-load-balancer-ip]

I was trying to figure out how to put this load balancer under its own domain and https whole day today, but was empty handed.

I already added my domain to DigitalOcean and it was really easy to point to my load balancers ip. However modern browsers always overwrite http to https so whenever I try to connect I get connection error page.

My only settings in load balancer are forwarding between TCP on port 80 -> TCP on port 30... I tried setting up https and http rules here as well, created new certificate, but still no luck.

Can anyone explain how to set this up and why is this not automatically done, as it is mentioned on https://www.digitalocean.com/products/load-balancer page.

apiVersion: v1
kind: Service
metadata:
  labels:
    app: my-server
  name: my-server
  namespace: default
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 8080
  selector:
    app: my-server
  type: LoadBalancer


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!

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.

Heya,

Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.

If you have configured your LoadBalancer correctly, the protocol should be set to HTTP on port 80. Here are a few things you need to check:

  • Ensure your DNS settings are correctly pointing your domain to your LoadBalancer IP. This can be done in the Domain settings in your DigitalOcean dashboard.
  • Once that is done, you need to setup an SSL certificate for your domain. This can be managed again under the Domain settings where you need to provide your certificate and private key.
  • Make sure your load balancer is correctly set up to forward HTTPS (port 443) to HTTP (port 80) which will then be handled by your Kubernetes service.

Additionally, it’s not typically automatically done because every setup is unique and might require different configurations.

A detailed step-by-step guide on how to set this up can be found at this link.

Hope that this helps!

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.