Search code examples
kubernetes

What is the use of Kubernetes cluster?


Every where its mentioned "cluster type of service makes pod accessible within a Kubernetes cluster"

Does it mean, after adding cluster service to a POD, then that POD can be connected only using cluster service IP of POD, we will not be able to connect POD using the IP of POD generated before adding cluster ?

Please help me understanding, am learning Kubernetes so.


Solution

  • When a service is created using the ClusterIP then that service is accessible only inside the cluster as service IP's are virtual IP.

    Although if you want to access the pod from outside using the service IP then you can use the nodeport or loadbalancer type service which will allow you to access the pod using the Node's IP or the loadbalancer's IP.

    Main reason behind using services to access pod is that it give a fixed location (ClusterIP or service name) to access. Pod's can come an go but service IP will remain same.