Exposing GKE Services
All of this magic that GKE and Kubernetes provides us would be for naught if you couldn't expose your services to other GCP-consuming services and the outside world. Don't fret, Kubernetes and GCP provide a wealth of functionality to appropriately expose applications and services to a myriad of different types of consumer.
When exposing your GKE cluster to traffic, you have three distinct options as to how you expose your services and applications:
- Cluster IP: Exposes your workload via internal IP to the cluster
- Node port: Exposes your workload via a specific port on each node within the cluster
- Load balancer: Creates a load balancer which then exposes your workload via an external IP address
Exposing services within a cluster
As mentioned earlier in the chapter, one of the key scenarios where Kubernetes and GKE are very beneficial is microservices. Once you deploy your services or application to a GKE container cluster, its pods are automatically assigned internal IP addresses...