Everything we have discussed so far has been about representing services inside the Kubernetes cluster. The service concept is also how applications are exposed outside of a cluster.
The default service type is ClusterIP, and we briefly touched upon the type ExternalName
, which was added to Kubernetes 1.7 to provide an external DNS reference. There are two other types that are very common, NodePort
and LoadBalancer
, which are specifically oriented towards exposing a service outside of the Kubernetes cluster.
The LoadBalancer
service type is not supported in all Kubernetes clusters. It is most commonly used with cloud providers such as Amazon, Google, or Microsoft, and coordinates with the cloud provider's infrastructure to set up an external LoadBalancer
that will forward traffic into the service.
How you define these services is specific to your cloud provider, and slightly different between AWS, Azure, and Google. LoadBalancer...