đ
Cloud Resources Setup
âąī¸ 15 minutes
Phase 1 of 7
âšī¸ Objective
Set up cloud infrastructure and development environment for MLOps pipeline
âī¸
Google Cloud Platform
Recommended for Kubeflow
â
Best Kubeflow support
â
Managed Kubernetes (GKE)
â
GPU instances available
â
$300 free credits
Start GCP Setup â
âī¸ Google Cloud Platform Setup
âąī¸
Estimated Time: 5-10 minutes
GCP offers the best Kubeflow support and managed Kubernetes. Perfect for production MLOps workflows.
1 Prerequisites & Account Setup
What you need:
- â Google Cloud account - Free tier available with $300 credits
- â gcloud CLI - Command-line interface for Google Cloud
- â kubectl - Kubernetes command-line tool
- â Credit card - For verification only (won't be charged)
Quick setup:
Install gcloud CLI
# Install gcloud CLI (macOS)
curl https://sdk.cloud.google.com | bash
# Install gcloud CLI (Linux)
curl https://sdk.cloud.google.com | bash
# Install gcloud CLI (Windows)
# Download from: https://cloud.google.com/sdk/docs/install
2 Create GCP Project
Create a new project to organize your MLOps resources and enable billing.
Create and Configure Project
# Create new project
gcloud projects create mlops-workshop --name="MLOps Workshop"
# Set project as default
gcloud config set project mlops-workshop
# Enable required APIs
gcloud services enable container.googleapis.com
gcloud services enable compute.googleapis.com
gcloud services enable storage.googleapis.com
gcloud services enable aiplatform.googleapis.com
gcloud services enable cloudbilling.googleapis.com
gcloud services enable gkehub.googleapis.com
# Verify APIs are enabled
gcloud services list --enabled
gcloud container fleet create --display-name="mlops-fleet"
âšī¸ đĄ Pro Tip
Replace the project name with something unique to you. The $(date +%s) adds a timestamp to make it unique.
3 Create Google Kubernetes Engine (GKE) Cluster
Create a managed Kubernetes cluster that will host your MLOps workloads.
Create GKE Cluster
# Create GKE cluster
gcloud container clusters create mlops-cluster \
--zone=us-central1-a \
--num-nodes=3 \
--machine-type=e2-standard-4 \
--enable-autoscaling \
--min-nodes=3 \
--max-nodes=5 \
--enable-autorepair \
--enable-autoupgrade \
--disk-size=50 \
--disk-type=pd-standard \
--enable-fleet
# This will take 5-10 minutes to complete
Cluster Configuration:
- âĸ 3 nodes with 4 vCPUs and 16GB RAM each (e2-standard-4)
- âĸ Auto-scaling enabled (1-5 nodes)
- âĸ Auto-repair and auto-upgrade enabled
- âĸ 50GB standard persistent disk per node
4 Connect to Your Cluster
Get cluster credentials and verify your connection.
Connect to Cluster
# Install GKE Auth Plugin
gcloud components install gke-gcloud-auth-plugin -q
# Get cluster credentials
gcloud container clusters get-credentials mlops-cluster --zone=us-central1-a
# Verify kubectl
kubectl version --client
# Verify connection
kubectl get nodes
# Check cluster info
kubectl cluster-info
Expected Output:
You should see 3 nodes listed with status "Ready". If you see any issues, wait a few minutes for the cluster to fully initialize.
5 Verify Setup
Run these commands to ensure everything is working correctly.
Verification Commands
# Check cluster status
kubectl get nodes -o wide
# Check available resources
kubectl top nodes
# Test kubectl connectivity
kubectl run test-pod --image=nginx --restart=Never
kubectl get pods
kubectl delete pod test-pod
â
đ GCP Setup Complete!
Your GCP environment is ready! You can now proceed to install Kubeflow in the next phase.
6 Cleanup (Optional)
When you're done with the workshop, you can delete the cluster to avoid charges.
Delete GKE Cluster
# Delete the cluster (this will remove all data)
gcloud container clusters delete mlops-cluster --zone=us-central1-a
# Confirm deletion when prompted
# This will take 5-10 minutes to complete
â ī¸ Important:
- âĸ This will permanently delete your cluster and all data
- âĸ You'll need to recreate everything if you want to continue
- âĸ Only run this when you're completely done with the workshop