How to Interact with Google Cloud Platform (GCP)
GKE Foundations — Section: How to Interact with Google Cloud Platform (GCP)
Let's understand this video from zero, with simple examples and practical commands. This topic is important because, while learning Kubernetes Engine (GKE), you'll use tools like Google Cloud Console, Cloud Shell, gcloud, and kubectl.
1. What is GCP?
Google Cloud Platform (GCP) is Google's cloud computing platform. Instead of purchasing and maintaining physical servers, you can use Google's infrastructure to run applications.
For example, imagine you have a Java Spring Boot application that you want to deploy.
You might need:
A virtual machine or Kubernetes cluster to run your application.
Storage to store files.
A network to connect services.
Monitoring to check CPU usage and application errors.
GCP provides these services, and you need tools to manage them.
2. The four ways to interact with GCP
1. Google Cloud Console
A website where you manage cloud resources using your mouse and keyboard.
Example: Open the GKE section and create a Kubernetes cluster by filling in a form.
2. Cloud Shell and Cloud SDK
Command-line tools for managing cloud resources.
Example: Run gcloud container clusters list to list GKE clusters.
3. Cloud Console Mobile App
Manage and monitor certain cloud resources from your phone.
Example: Check billing information, view logs, and monitor metrics.
4. REST-based APIs
Allow applications to communicate with Google Cloud services programmatically using HTTP requests.
Example: A custom automation application requests the creation or modification of a cloud resource through an API.
For this course, focus primarily on the Console, Cloud Shell, gcloud, and kubectl.
3. Google Cloud Console
The Google Cloud Console is a web-based graphical user interface (GUI).
Website: Open Google Cloud Console
You can use it to:
Create and manage virtual machines.
Create Kubernetes clusters.
View cloud resources.
Check monitoring and billing.
Configure cloud services.
Example: Suppose you want to create a GKE cluster. In the Console, you can navigate to Kubernetes Engine, choose Create, configure the cluster, and submit the form.
You don't need to remember a command for every operation.
One important concept is the GCP project. Resources are organized under projects, which help you manage access, billing, and resources.
4. Cloud SDK and its important commands
The video introduces the Cloud SDK, which provides command-line tools for interacting with GCP. In current Google Cloud terminology, the main command-line package is the Google Cloud CLI.
Here are the tools you should remember.
Tool | Purpose | Example |
|---|---|---|
| Manage Google Cloud resources | List GKE clusters |
| Manage Kubernetes resources | List Pods |
| Work with Cloud Storage | Copy files to a bucket |
| Work with BigQuery | Run data queries |
Understand gcloud vs kubectl
This is one of the most important distinctions in the course.
gcloud — Google Cloud level
Used to manage the cloud infrastructure, including GKE clusters.
gcloud container clusters listThis lists the Kubernetes clusters in your selected GCP project.
kubectl — Kubernetes level
Used to manage workloads and resources inside a Kubernetes cluster.
kubectl get podsThis lists Pods in the currently selected Kubernetes namespace.
Think of it this way:
gcloudhelps you create or manage the Kubernetes cluster itself.kubectlhelps you manage what runs inside that cluster.
5. What is Cloud Shell?
Cloud Shell is a command-line environment available directly inside your web browser.
You can open the Google Cloud Console and click the Activate Cloud Shell terminal icon.
Why is it useful?
Normally, to run cloud commands on your own computer, you may need to install and configure command-line tools. Cloud Shell provides a ready-to-use environment with Google Cloud tools already installed and authentication integrated.
For example, you can run:
gcloud --version
kubectl version --clientYou can also use a terminal editor or a browser-based code editor to edit files.
How does Cloud Shell work?
The video explains these key characteristics:
Managed environment: It runs on a Google-managed Compute Engine virtual machine.
Temporary compute: The VM can stop when inactive and restart when you return.
Persistent storage: Your home directory has persistent disk storage, historically described in the video as 5 GB.
Authentication: It integrates with your Google Cloud identity and authorization.
Web preview: It can preview web applications running in the environment.
Cloud Shell is convenient for learning and administration, but it is not intended to host your production application. Also, check current Google Cloud documentation for the latest storage, lifecycle, and billing terms.
6. How Cloud Shell fits into GKE
Imagine you are deploying your Spring Boot application to GKE.
Your browser -> Google Cloud Console ->Cloud Shell ->Run gcloud and kubectl ->GCP / GKE ->
Infrastructure and clusters ->Kubernetes ->Pods and deployments
A typical sequence of commands looks like this:
# 1. Check the active GCP project
gcloud config get-value project
# 2. List available GKE clusters
gcloud container clusters list
# 3. Configure kubectl to access a cluster
gcloud container clusters get-credentials CLUSTER_NAME \
--location=REGION
# 4. Check the cluster nodes
kubectl get nodes
# 5. Check the Pods
kubectl get podsReplace CLUSTER_NAME and REGION with your actual cluster name and location. These commands require an appropriately configured project, permissions, and (for the GKE steps) an existing cluster.
7. What is the Cloud Console Mobile App?
Google also provides a mobile app for Android and iOS.
It can help you:
Check project billing.
View supported resource logs.
Monitor metrics such as CPU and network usage.
Receive billing alerts and review dashboards, where supported.
You don't need to use the mobile app for this specialization. It is simply another way to access cloud management features.
8. Quick revision notes
Concept | Remember this |
|---|---|
Cloud Console | Graphical interface for GCP |
Cloud Shell | Browser-based command-line environment |
Cloud SDK / Google Cloud CLI | Tools for running Google Cloud commands |
| Manages Google Cloud resources |
| Manages Kubernetes resources |
| Cloud Storage command-line utility |
| BigQuery command-line utility |
REST APIs | Let applications interact with cloud services programmatically |
Mobile app | Access selected management and monitoring features |
Comments
Post a Comment