How can I identify the IP for Kong on Kubernetes cluster on RHEL machines? How can I identify the IP for Kong on Kubernetes cluster on RHEL machines? kubernetes kubernetes

How can I identify the IP for Kong on Kubernetes cluster on RHEL machines?


By the information you shared I could suppose you are trying to run the command outside the Cluster.

If you are doing this, it will not working, because you can't reach the ClusterIP services outside the cluster.

ClusterIP: Exposes the Service on a cluster-internal IP. Choosing this value makes the Service only reachable from within the cluster. This is the default ServiceType.

To check if the server you are connected is part of the cluster, type kubectl get nodes -owide e try to find the the ip in the list.

I see your service service/kong-proxy is with EXTERNAL-IP: <pending>, it's probably is occurring because you are trying to use a bare metal installation of Kubernetes, in this case you need to use MetalLB to make your LoadBalancer configuration working.

An alternative to test your service is use kubectl port-foward, this will map your service to localhost and you can acces by http://localhost:8080. Example:

kubectl port-forward svc/kong-proxy -n kong 8080:80

This command will map your service on port 8080 of your localhost.

References:

Services types

MetalLB

port-forward


Cluster IPs are not reachable from outside the cluster and from host machines where kubernetes is deployed. You need to use service of type Load Balancer or Nodeport to access it from outside the cluster or form host machines.

Looking at status pending for external IP of LoadBalancer type service it seems you are not deploying kubernetes on public cloud providers. LoadBalancer type service only works on suppported cloud providers(ex AWS, GCP).

If you are on prem then Nodeport Type service is what you can use.

From Kong docs on when to use Nodeport while deploying Kong.

If your Kubernetes cluster is running in a cloud environment, where Load Balancers can be provisioned with relative ease, it is recommended that you use a Service of type LoadBalancer to expose Kong to the outside world. For the Ingress Controller to function coorrectly, it is also required that a L4 (or TCP) Load Balancer is used and not an L7 (HTTP(s)) one.

If your Kubernetes cluster doesn't support a service of type LoadBalancer, then it is possible to use a service of type NodePort.