Chapter 11
Deploy Applications with Kubernetes to the Cloud

In the previous chapter, we put the work into making our service deployable, but we only deployed it locally. In this chapter, we’ll deploy our service to the cloud and put it on the Internet. Kubernetes abstracts the resources needed for your applications—containers, networking, volumes, and so on—similar to how Go abstracts the operating system and processor architecture so you can run the same program on each. As such, the changes you need to make to take your local Kubernetes cluster to the cloud can be little to nothing.

Three major cloud platforms dominate the landscape: Google Cloud Platform (GCP),[63] Amazon Web Services (AWS),[64] and Microsoft Azure.[65] All three platforms provide similar feature sets and their own Kubernetes services. With Kubernetes making up the differences between the platforms, we can deploy to any one, easily move between providers (and bargain with the providers for better prices), or run across them all at the same time. In this chapter, we’ll deploy our service to the Google Cloud Platform.

GCP provides a free tier of products, with limitations, along with $300 credit to spend during your twelve-month free trial. What matters to us for purposes of our work in this book is that the free tier includes one Kubernetes cluster and 5 GB of storage—good enough to deploy our service to the cloud. Though Google won’t charge you for the free trial, you need a credit card to sign up, and during the trial, Google displays a banner showing how many credits and how much time you have left so you know your status. Once your trial is over and/or you decide to purchase the service and use more of the platform, Google requires you to enable automatic billing.