Welcome to this course on deploying containers with Google Kubernetes Engine (GKE)! If you've worked with Docker containers before, you know they're great for packaging applications. But what happens when you need to run dozens or hundreds of containers across multiple servers? What if a container crashes and needs to restart automatically? What if you need to update your application without downtime? These are the challenges that Kubernetes was built to solve.
In this lesson, you'll learn what Kubernetes is and how Google Kubernetes Engine makes it easier to use. You'll see how to use the gcloud CLI for GKE-specific tasks and get introduced to kubectl, the standard command-line tool for Kubernetes. By the end of this lesson, you'll understand the role each tool plays in managing your containerized applications on GKE.
Kubernetes is a container orchestrator. Think of it as a smart manager for your containers. Just as a restaurant manager decides which servers handle which tables, monitors if anyone needs a break, and brings in extra staff during busy hours, Kubernetes decides which servers run which containers, monitors their health, and scales them up or down based on demand.
Let's make this more concrete with a real-world example. Imagine you have a web application running in containers. Without Kubernetes, if that container crashes, your application goes down until someone manually restarts it. If traffic increases, you need to manually start more containers and figure out how to distribute traffic between them. If you want to update your application, you need to carefully coordinate stopping old containers and starting new ones without causing downtime.
Kubernetes solves these problems automatically. It continuously monitors your containers and restarts them if they crash. It can automatically scale the number of containers based on CPU usage or other metrics. It handles rolling updates, where new versions gradually replace old ones without downtime. It also manages networking so that containers can communicate with each other and external traffic can reach your application. These capabilities make Kubernetes essential for running production applications at scale.
Google Kubernetes Engine (GKE) is Google Cloud's managed Kubernetes offering, which means Google Cloud handles the complex parts of running Kubernetes for you. To understand what this means, you need to know that Kubernetes has two main components: the control plane and the worker nodes.
The control plane is the brain of Kubernetes. It makes all the decisions about where containers should run, monitors the health of everything, and responds to changes. Running a control plane requires multiple servers working together, regular updates, backups, and constant monitoring. This is complicated and time-consuming to manage yourself.
With GKE, Google Cloud runs and manages the entire control plane for you. Google ensures it's highly available across multiple zones, applies security patches, performs backups, and monitors its health. You don't have to worry about any of this infrastructure. What you do manage are the worker nodes, which are the servers where your containers actually run. You also manage your applications and how they're deployed. This division of responsibility means you can focus on your applications rather than maintaining Kubernetes infrastructure.
GKE offers different cluster modes. In Standard mode, you have more control over node configuration and management. In Autopilot mode, Google Cloud manages even more of the infrastructure, including node provisioning and scaling, allowing you to focus almost entirely on your applications. Throughout this course, we'll work with Standard mode to give you a complete understanding of cluster management.
Throughout this course, you'll primarily work with two command-line tools: gcloud and kubectl. While you're already familiar with gcloud for managing Google Cloud resources, you'll now focus on its GKE-specific capabilities. The new tool you'll learn is kubectl, the standard interface for any Kubernetes cluster.
As you know, the gcloud CLI is used to manage Google Cloud resources. For GKE, you'll use the gcloud container command group for all cluster-level operations. For example, you'll use gcloud container clusters create to create a new cluster, gcloud container clusters list to view your clusters, and gcloud container clusters delete to remove a cluster. You'll continue to use gcloud for managing supporting infrastructure like Cloud Storage buckets or IAM permissions.
The kubectl tool is the standard Kubernetes command-line interface. It works with any Kubernetes cluster, whether it's running on GKE, Amazon Web Services, your own servers, or even your laptop. You'll use kubectl to deploy applications, check the status of your containers, view logs, and perform day-to-day operations on your cluster. This is the tool you'll probably use most often once your cluster is running.
Unlike some other cloud providers, Google Cloud doesn't have a separate third tool for cluster management. Instead, all GKE-specific operations are integrated into the CLI through the command group. This unified approach leverages your existing knowledge of .
The version numbers you see in this course (Kubernetes 1.29, gcloud 450.0.0) are examples and may differ from what's currently installed in your environment or supported by Google Cloud. This is completely normal and expected.
Kubernetes versions: GKE typically supports the latest 3–4 minor versions of Kubernetes. Before creating any cluster, always verify which versions are currently supported. You can check available versions for your region:
This command displays detailed information about available Kubernetes versions, including which versions are default, supported, and available for new clusters. The output includes both the control plane versions and the node versions.
Official Documentation: Visit the GKE release notes and GKE versioning and support documentation for the official support matrix and version lifecycle information.
Version Selection Best Practice:
- Use the default version for stability unless you have specific requirements.
- GKE automatically handles version upgrades for the
control plane. - You can configure automatic node upgrades or manage them manually.
- Always quote versions as strings in YAML:
"1.29", not1.29.
The kubectl tool is your primary interface for working with Kubernetes. It communicates with the Kubernetes control plane to execute commands and retrieve information about your cluster. Understanding how kubectl works will help you manage your applications effectively.
When you run a kubectl command, it sends an API request to the Kubernetes control plane. The control plane processes the request and returns the results. For example, when you deploy an application, kubectl sends the deployment configuration to the control plane, which then schedules the containers to run on appropriate worker nodes.
The kubectl tool uses a configuration file (typically located at ~/.kube/config) to know which cluster to connect to and how to authenticate. When you create a GKE cluster, this configuration file is automatically updated with the connection details. This means you can manage multiple Kubernetes clusters by switching between different configurations.
You can check the version of kubectl installed in your environment:
The --client=true flag tells to only check the client version without trying to connect to a cluster, since you haven't created one yet. The flag formats the output in a readable structure:
You'll leverage the gcloud CLI to manage your GKE clusters. The GKE-specific functionality is organized under the gcloud container command group, which provides everything you need to create, configure, and manage your Kubernetes clusters.
When you create a cluster with gcloud container clusters create, it performs numerous operations behind the scenes. It uses an existing VPC (Virtual Private Cloud) network—by default, the default network in your project—and configures subnets and firewall rules for the cluster. It also creates service accounts with the correct IAM permissions, launches the GKE control plane, and provisions worker nodes. It also configures networking for pod-to-pod communication and sets up load balancing capabilities. Doing all of this manually would require dozens of commands and careful coordination.
The gcloud tool integrates with Google Cloud's infrastructure management systems, which means all the resources it creates are tracked and can be updated or deleted as a group. This makes cluster management much more reliable and predictable. Additionally, gcloud automatically updates your kubectl configuration so you can immediately start working with your new cluster.
You can check your gcloud version as you've done before:
This displays version information for the gcloud CLI and its components:
Understanding how gcloud and kubectl complement each other is key to working efficiently. Each tool has its own domain of responsibility.
As you've done in the past, you'll use gcloud for Google Cloud infrastructure tasks. This includes managing IAM policies, creating Cloud Storage buckets, and configuring Cloud Logging. For GKE, you'll also use the gcloud container clusters commands for all cluster-level operations, such as creating new clusters, resizing node pools, updating cluster configurations, and deleting clusters.
You'll use the new kubectl tool for application-level operations within your cluster. This includes deploying applications, scaling deployments, viewing logs, executing commands in containers, and managing Kubernetes resources like services and ingresses. Once your cluster is running, kubectl is the tool you'll use most frequently for day-to-day application management.
For example, a typical workflow might look like this: First, you use gcloud container clusters create to create a new GKE cluster. The command automatically configures kubectl to connect to your new cluster. Then, you use kubectl to deploy your application to the cluster. If your application needs to store data in Cloud Storage, you use familiar commands like gcloud storage buckets create and gcloud projects add-iam-policy-binding to configure the necessary resources and permissions. If you need to scale your cluster by adding more worker nodes, you use . If you need to scale your application by running more container replicas, you use .
In this lesson, you learned that Kubernetes is a container orchestrator that automates the deployment, scaling, and management of containerized applications. Google Kubernetes Engine (GKE) is Google Cloud's managed Kubernetes service that handles the complex control plane for you, allowing you to focus on running your applications rather than managing Kubernetes infrastructure.
You were introduced to kubectl, the standard command-line tool for Kubernetes operations, and learned how to use the gcloud container command group to manage your GKE clusters. You saw how your existing gcloud skills for managing Google Cloud infrastructure and the new kubectl tool for managing applications work together to provide a complete solution for running containerized applications on Google Cloud Platform.
In the upcoming practice exercises, you'll verify these tools are working in your environment and explore their help documentation. After that, you'll be ready to create your first GKE cluster and start deploying containers. The foundation you've built in this lesson will support everything you do throughout the rest of this course.
