π A Complete Guide to Google Kubernetes Engine (GKE) with Step-by-Step Execution

I am Bittu Sharma, a DevOps & AI Engineer with a keen interest in building intelligent, automated systems. My goal is to bridge the gap between software engineering and data science, ensuring scalable deployments and efficient model operations in production.! ππ²π'π ππΌπ»π»π²π°π I would love the opportunity to connect and contribute. Feel free to DM me on LinkedIn itself or reach out to me at bittush9534@gmail.com. I look forward to connecting and networking with people in this exciting Tech World.
Kubernetes (K8s) has become the de facto standard for container orchestration. While setting up Kubernetes clusters manually can be challenging, cloud providers like Google Cloud Platform (GCP) simplify the process with Google Kubernetes Engine (GKE).
In this blog, weβll dive into:
What GKE is and why itβs used
Key features of GKE
Step-by-step execution (with commands)
Deploying an NGINX application on GKE
Real-world use cases
πΉ What is Google Kubernetes Engine (GKE)?
Google Kubernetes Engine (GKE) is a managed Kubernetes service offered by Google Cloud. It allows developers and DevOps engineers to deploy, manage, and scale containerized applications without worrying about the complexities of managing Kubernetes infrastructure.
π Simply put, GKE = Kubernetes + Google Cloud automation + scalability.
πΉ Why Use GKE?
Some key benefits of GKE:
β
Managed Control Plane β Google handles cluster upgrades, patches, and scaling.
β
Auto-Scaling β Automatically scales your cluster based on workload.
β
Integrated with GCP β Easy integration with IAM, Cloud Monitoring, Logging, and Storage.
β
Security β Automatic upgrades, RBAC, private clusters, and workload identity.
β
High Availability β Regional clusters ensure workloads are resilient.
πΉ GKE Cluster Architecture
A GKE cluster consists of:
Control Plane (Master): Managed by Google (API Server, Scheduler, Controller).
Node Pools: Virtual Machines (VMs) in GCP where containers run.
Pods: Smallest deployable unit containing your containers.
πΉ Prerequisites
Before starting, ensure you have:
A Google Cloud Account (Free Tier gives $300 credits).
gcloud CLI installed β Install Guide.
kubectl CLI installed.
πΉ Step 1: Authenticate with GCP
First, authenticate your gcloud CLI:
gcloud auth login
gcloud config set project <YOUR_PROJECT_ID>
Check your active project:
gcloud config list project
πΉ Step 2: Create a GKE Cluster
Letβs create a GKE cluster named my-gke-cluster with 3 nodes.
gcloud container clusters create my-gke-cluster \
--zone us-central1-a \
--num-nodes=3
π This will provision a Kubernetes cluster with 3 worker nodes in us-central1-a.
πΉ Step 3: Connect to Your Cluster
Once the cluster is ready, connect using kubectl:
gcloud container clusters get-credentials my-gke-cluster --zone us-central1-a
Now check your cluster nodes:
kubectl get nodes
Expected Output π
NAME STATUS ROLES AGE VERSION
gke-my-gke-cluster-default-pool-... Ready <none> 1m v1.29.x
πΉ Step 4: Deploy an Application (NGINX)
Letβs deploy a sample NGINX web application on GKE.
Create a Deployment
kubectl create deployment nginx-deployment --image=nginx
Verify deployment:
kubectl get deployments
kubectl get pods
Expose the Deployment
Expose the deployment using a LoadBalancer service:
kubectl expose deployment nginx-deployment \
--type=LoadBalancer \
--port=80 \
--target-port=80
Check service details:
kubectl get service
Expected Output π
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nginx-deployment LoadBalancer 10.0.34.250 34.67.xxx.xxx 80:30871/TCP 1m
π Copy the EXTERNAL-IP and paste in your browser β you should see the default NGINX welcome page π.
πΉ Step 5: Scale Your Application
Scaling up your app in GKE is easy:
kubectl scale deployment nginx-deployment --replicas=5
Check pods:
kubectl get pods -o wide
Now youβll see 5 replicas of NGINX running in your GKE cluster.
πΉ Step 6: Clean Up Resources
To avoid unnecessary billing, delete your cluster when done:
gcloud container clusters delete my-gke-cluster --zone us-central1-a
πΉ Real-World Use Cases of GKE
GKE is widely used in production for:
Microservices Architecture β Managing multiple containerized services.
CI/CD Pipelines β Deploying applications using GitOps or Jenkins.
Big Data & AI β Running ML pipelines and data processing workloads.
Hybrid Cloud β Using Anthos to extend GKE across on-premises and multi-cloud.
πΉ Final Thoughts
GKE simplifies Kubernetes by removing the complexity of managing the control plane and providing powerful features like auto-scaling, security, and deep GCP integration.
In this blog, we:
βοΈ Learned what GKE is
βοΈ Set up a GKE cluster
βοΈ Deployed and scaled an application
βοΈ Understood real-world use cases
π If youβre a DevOps Engineer, Cloud Engineer, or Developer, mastering GKE will boost your cloud-native journey π.




