What is the use of external IP address option in kubernetes service when the service is of type ClusterIP
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With