what is the use of external IP address with a ClusterIP service type in kubernetes

3/18/2019

What is the use of external IP address option in kubernetes service when the service is of type ClusterIP

-- Hrishikesh
kubernetes

4 Answers

3/18/2019

When you are using service with type: ClusterIP it has only Cluster IP and no external IP address <none>.

-- Ivan Aracki
Source: StackOverflow

3/28/2019

ClusterIP is unique Ip given from IP pool to a service and to access pods of this service cluster IP can be used only inside a cluster.Cluster IP is default service type in kubernetes.

kubectl expose deployment nginx --port=80 --target-port=80 --type=LoadBalancer

above example will create a service with external IP and cluster IP. In case of loadbalancer,nodeport services ,the service can be accessed from other clusters through externalIP

-- shubham_asati
Source: StackOverflow

3/20/2019

ClusterIP is the default service type in Kubernetes which allows you to reach your service only within the cluster.

If your service type is set as LoadBalancer or NodePort, ClusterIP is automatically created and LoadBalancer or NodePort service will route to this ClusterIP IP address.

The new external IP addresses are only allocated with LoadBalancer type.

You can also use the node's external IP addresses when you set your service as NodePort. But in this case you will need extra firewall rules for your nodes to allow ingress traffic for your exposed node ports.

-- coolinuxoid
Source: StackOverflow

3/18/2019

An ExternalIP is just an endpoint through which services can be accessed from outside the cluster, so a ClusterIP type service with an ExternalIP can still be accessed inside the cluster using its service.namespace DNS name, but now it can also be accessed from its external endpoint, too. For instance, you could set the ExternalIP to the IP of one of your k8s nodes, or create an ingress to your cluster on that IP.

-- kellanburket
Source: StackOverflow