Home > Software design >  Accessing pods through ClusterIP
Accessing pods through ClusterIP

Time:06-23

I want to create a cluster of RESTful web APIs in AWS EKS and be able to access them through a single IP (allowing kubernetes to load balance requests to each). I have followed the procedure explained the this enter image description here

The problem is that when I access the example nginx deployment via 172.31.22.183 it works just fine, but when I try to use the cluster IP 10.100.145.181 it does not yield any response in such a way that it seems to be unreachable.

What's the purpose of that cluster ip then and how can I use it to achieve what I need?

CodePudding user response:

What's the purpose of that cluster ip then and how can I use it to achieve what I need?

ClusterIP is local IP that is used internally in the cluster, you can use it to access the application.

While i think Endpoint IP that you got, is might be external and you can access the application outside.

AWS EKS and be able to access them through a single IP (allowing kubernetes to load balance requests to each)

For this best practice is to use the ingress, API gateway or service mesh.

Ingress is single point where all your request will be coming inside it will be load balancing and forwarding the traffic internally inside the cluster.

Consider ingress is like Loadbalancer single point to come inside the cluster.

Ingress : https://kubernetes.io/docs/concepts/services-networking/ingress/

AWS Example : https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/

CodePudding user response:

ClusterIP is an IP that is only accessible inside the cluster. You cannot hit it from outside cluster unless you use kubectl port-forward

  • Related