Intro to GKE: Deploy, Scale and Update
Introduction
Running websites and applications is hard.
Things go wrong when they shouldn’t, servers crash, increase in demand causes more resources to be utilized, and making changes without downtime is complicated and stressful.
Imagine a tool that could help you do all that and even allow you to automate it! With GKE, all of that is not only possible, it’s easy! In this gHack, you assume the role of a developer running an eCommerce website for a fictional company named Fancy Store. Due to problems with scaling and outages, you’re tasked with deploying your application to GKE!
Learning Objectives
In this gHack you will experience what a cloud developer needs to go through to successfully deploy an application. You will learn to:
- Create a GKE cluster.
- Create a Docker container.
- Deploy the container to GKE.
- Expose the container via a service.
- Scale the container to multiple replicas.
- Modify the application.
- Perform a zero downtime rolling update on Kubernetes
Challenges
- Challenge 1: Provision a GKE Cluster
- Create a new GKE cluster that you’ll use to deploy, scale and update your application
- Challenge 2: Containerizing your Application
- Run your application in a stand alone fashion and then containerize it to prepare it for deployment to GKE
- Challenge 3: Deploy and Expose the Application
- Using your containerized app in Artifact Registry, deploy it to GKE and expose it to the public internet
- Challenge 4: Scale the Application to Handle Increased Traffic
- Now that the application is deployed and out there, we’ve noticed an increase in traffic and need to scale out to handle the new load
- Challenge 5: Update and Release with Zero Downtime
- Change is inevitable, but new releases need to be deployed smoothly. Here we learn how to do that with zero downtime
Prerequisites
- Your own GCP project with Owner IAM role
- A basic understanding of Docker and Kubernetes
- If you lack a basic understanding, you can review Docker and Kubernetes now.
- Access to an environment with the following
- gcloud (>= 410.0.0)
- node.js (>= v19.1.0)
- Note Cloud Shell has these pre-installed
Contributors
- Gino Filicetti