GCP DevOps Project

Sprint 02

Sprint 02 review

Welcome back! In this lesson, we recap Sprint 02, where we focused on:

ObjectiveDescription
Create a GCP accountSign up for Google Cloud Platform and configure billing.
Learn GKE fundamentalsUnderstand Kubernetes architecture and Google Kubernetes Engine (GKE).
Set up a GKE clusterDeploy and initialize a Kubernetes cluster on GCP.

What We Achieved

  1. GCP Account Setup

  2. GKE Fundamentals

    • Explored key concepts: nodes, pods, control plane, and networking.
    • Reviewed GKE-specific features like auto-scaling and regional clusters.
  3. Cluster Provisioning

    • Created a GKE cluster using the gcloud CLI.
    • Retrieved credentials and verified the cluster’s health.

Warning

Make sure your IAM user has the Kubernetes Engine Admin role before creating a cluster. Insufficient permissions will cause gcloud container clusters create to fail.


Essential gcloud & kubectl Commands

# Authenticate with GCP
gcloud auth login

# Set your project ID
gcloud config set project YOUR_PROJECT_ID

# Create a GKE cluster in us-central1-a
gcloud container clusters create my-cluster \
  --zone us-central1-a \
  --machine-type e2-medium \
  --num-nodes 3

# Retrieve cluster credentials for kubectl
gcloud container clusters get-credentials my-cluster \
  --zone us-central1-a

# Verify node status
kubectl get nodes

Note

Always run gcloud container clusters get-credentials before executing kubectl commands. This ensures your CLI is pointed to the correct cluster endpoint.


Key Takeaways

  • Defining sprint tasks is just the starting point; dive into related subtasks (e.g., authentication, IAM) for a deeper understanding.
  • Hands-on practice with gcloud and kubectl cements your GKE workflow.
  • Validating cluster connectivity early prevents common deployment headaches.

Next Steps: Sprint 03 Preview

In Sprint 03, we will:

  • Deploy a sample application using a Kubernetes Deployment and Service.
  • Scale workloads with the Horizontal Pod Autoscaler.
  • Perform rolling updates to achieve zero-downtime releases.

Watch Video

Watch video content

Previous
Connecting to GKE cluster using Cloud shell