Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access an internal service on a loadbalancer

I am deploying a k8s cluster locally using Kind. The image gets deployed ok and when I view the list of services I see the following

enter image description here

the service I'm trying to access is chatt-service and if you notice the EXTERNAL-IP is pending. I know minikube has a command which makes this accessible, but how do I do it on a Kind cluster ?

like image 214
tmp dev Avatar asked Sep 01 '25 22:09

tmp dev


2 Answers

for Loadbalancer service type you will not able to get public ip because you're running it locally and you will need to run it in a cloud provider which will provide the LB for you like ALB in aws or LoadBalancer in Digital ocean. however, you can access this service locally using the Kubectl proxy tool.

.

kubectl port-forward service/chatt-service 3002:3002
like image 151
sameh Ammar Avatar answered Sep 03 '25 17:09

sameh Ammar


There are some additional options to work on LoadBalancer under Kind cluster. (While the port forwarding is the simplest way).

https://kind.sigs.k8s.io/docs/user/loadbalancer/

First way:

You can also expose pods and services using extra port mappings this mean manually set ports in cluster-config.yaml

And maybe second way (but not actually the solution on LoadBalancer):

You may want to check out the Ingress Guide as a cross-platform workaround

like image 33
Mikhail_Sam Avatar answered Sep 03 '25 17:09

Mikhail_Sam