How do I make requests on a service of type LoadBalancer in Kubernetes?

5/20/2019

I would like to be able to make HTTP requests on the service. Let me know if I need to post more information. Thank you! I've tried to curl the cluster-IP:30480 and ens160-ip:30480 and neither work. How would I make a simple request to the service?

kubectl get services kong-admin

    NAME         TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
kong-admin   LoadBalancer   10.107.174.32   <pending>     8001:30480/TCP   9d

kubectl describe svc kong-admin

Name:                        kong-admin
Namespace:                   default
Labels:                      <none>
Annotations:                 <none>
Selector:                    app=kong
Type:                        LoadBalancer
IP:                          10.107.174.32
Port:                        kong-admin  8001/TCP
TargetPort:                  8001/TCP
NodePort:                    kong-admin  30480/TCP
Endpoints:                   10.244.1.17:8001,10.244.2.18:8001,10.244.3.16:8001
Session Affinity:            None
External Traffic Policy:     Cluster
LoadBalancer Source Ranges:  0.0.0.0/0
Events:                      <none>
-- ShadyBears
kubernetes

1 Answer

5/20/2019

You have created a service of type LoadBalancer. You can access it at http://kong-admin

If you just want the access from within the cluster, create a service of type ClusterIP

-- Rajesh Gupta
Source: StackOverflow