Hi, I created a kubernetes cluster. I created a deployment and service load balancer but I can not access the application through external IP.
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hi there,
When you deploy an application in a DigitalOcean Managed Kubernetes cluster and expose it using a Service of type
LoadBalancer
, DigitalOcean provisions a load balancer that directs traffic to the appropriate pods.If you can’t access your application through the external IP, there could be several reasons:
Verify the Service Status:
Check the status of your Kubernetes service to make sure it’s up and has an external IP assigned:
Ensure that the service shows an
EXTERNAL-IP
and is not stuck in<pending>
status.Service Port & Target Port:
When defining your service, make sure the service’s port and the target port match the port your application is listening on within the container.
For example:
Here, the load balancer listens on port 80, but directs traffic to pods on port 8080.
Besides that, you need to ensure that your application is listening on
0.0.0.0
and not127.0.0.1
. If it’s listening only on localhost (127.0.0.1), it won’t be accessible from outside the pod.You can also try to, log into your DigitalOcean dashboard and navigate to the
Networking
->Load Balancers
section. Ensure your load balancer is correctly set up, is healthy, and is directing traffic to the correct droplets/nodes.Besides all that, have you tried checking your application logs?
And also describe the service to check for any events or issues:
Let me know how it goes!
Best,
Bobby