message
Cloud Computing

How to Deploy a Kubernetes Cluster on Google Cloud Platform (GCP)

How to Deploy a Kubernetes Cluster on Google Cloud Platform (GCP) using Console (Standard Mode)Blog banner

Google Kubernetes Engine (GKE) is a managed Kubernetes service that simplifies the deployment and scaling of containerized applications. In this blog, you'll learn how to deploy a Kubernetes cluster using the GCP Console (Standard Mode) and expose a basic NGINX application using a LoadBalancer.

Prerequisites

Make sure you have:

  • A Google Cloud account
  • A GCP Project created
  • Billing enabled
  • Kubernetes Engine API enabled
  • [Optional] gcloud CLI installed locally

Step 0: Install gcloud CLI (Optional but recommended)

If you want to connect to GKE from your local terminal:

  1. Download and install the gcloud CLI:

Code

curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-454.0.0-linux-x86_64.tar.gz
tar -xf google-cloud-cli-454.0.0-linux-x86_64.tar.gz
./google-cloud-sdk/install.sh
export PATH="$HOME/google-cloud-sdk/bin:$PATH"
source ~/.bashrc
gcloud version
      

        2. Initialize the CLI

Code

gcloud init
      

         3. Install kubectl:

Code

gcloud components install kubectl
      

Step 1: Create a GKE Cluster (Console UI)

Go to: GCP Console > Kubernetes Engine > Clusters

Click “Create Cluster”, and choose:

  • Mode: Standard
  • Cluster Basics:
    • Name: my-gke-cluster
    • Location type: Zonal
    • Zone: us-central1-a
    • Release Channel: Regular (recommended)
Create a GKE Cluster

Step 2: Configure Default Node Pool

Under default-pool, configure:

  • Nodes: 2
  • Machine Type: e2-medium
  • OS Image: Ubuntu
  • Disk Size: 20 GB
Configure Default Node Poo

Optional: Enable Autoscaler

  • Enable cluster autoscaler
  • Min nodes: 2
  • Max nodes: 4
  • Location policy: Any
  • Size limit type: Total limits
Autoscaling lets your cluster grow/shrink based on workload

Autoscaling lets your cluster grow/shrink based on workload.

Step 3: Networking Configuration

  • Use the default VPC You may also use a private custom VPC based on your security needs.

Step 4: Click “Create”

Once all settings are done, click Create and wait ~3–5 minutes.

Step 5: Connect to the Cluster

You can either use Cloud Shell or your local terminal (with gcloud installed).

Using Cloud Shell

Click “Connect” on your cluster → Copy the gcloud command and run in Cloud Shell.

Using Local CLI

Code

gcloud container clusters get-credentials my-gke-cluster --zone us-central1-a --project [PROJECT_ID]
      

Step 6: Deploy NGINX to GKE

1. Create the deployment

Code

kubectl create deployment nginx --image=nginx   
      

2. Expose with LoadBalancer

Code

kubectl expose deployment nginx --port=80 --target-port=80 --type=LoadBalancer     

Step 7: Access Your App

To get the external IP:

Code

kubectl get svc      
      

Wait until the EXTERNAL-IP field shows a public IP (may take 1–2 mins). Open that IP in your browser, and you should see the NGINX Welcome Page.

Hire Now!

Hire DevOps Engineers Today!

Ready to elevate your digital product's user experience? Start your project with Zignuts expert DevOps Engineers.

**Hire now**Hire Now**Hire Now**Hire now**Hire now

Conclusion

You have now:

  • Created a GKE cluster via the GCP Console
  • Connected via CLI
  • Deployed a basic NGINX app
  • Exposed it using a LoadBalancer

Need help with Kubernetes or cloud deployments?

Our expert DevOps team can assist you in setting up a scalable, secure infrastructure on GCP. Contact us today to get started!

card user img
Twitter iconLinked icon

A dedicated architect of robust, scalable, and secure infrastructure solutions that bridge the gap between development and operations.

Book a FREE Consultation

No strings attached, just valuable insights for your project

Valid number
Please complete the reCAPTCHA verification.
Claim My Spot!
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
download ready
Thank You
Your submission has been received.
We will be in touch and contact you soon!
View All Blogs