Lab 01: Step-by-Step Guide
Prerequisites Check
Before starting, ensure you have:
# Check common tools (required for both providers)
terraform version # Should be >= 1.5
kubectl version --client
helm versionGCP-Specific Prerequisites
# Check GCP tools
gcloud version
# Check GCP authentication
gcloud auth list
gcloud config get-value projectAWS-Specific Prerequisites
# Check AWS tools
aws --version
# Check AWS authentication
aws sts get-caller-identity
aws configure listStep 1: Choose Your Provider
Edit terraform.tfvars and set:
cloud_provider = "gcp" # or "aws"Step 2: Configure Provider-Specific Settings
Option A: GCP Configuration
# Set your project
export PROJECT_ID="your-project-id"
gcloud config set project $PROJECT_ID
# Enable required APIs
gcloud services enable \
container.googleapis.com \
compute.googleapis.com \
artifactregistry.googleapis.com \
logging.googleapis.com \
monitoring.googleapis.comEdit terraform.tfvars:
cloud_provider = "gcp"
project_id = "your-project-id"
cluster_name = "implementation-studio"
region = "us-central1"
machine_type = "e2-medium"Option B: AWS Configuration
# Verify AWS credentials
aws sts get-caller-identity
# Verify you have required permissions for EKS
aws iam get-role --role-name AWSServiceRoleForAmazonEKS || echo "Service-linked role will be created automatically"Edit terraform.tfvars:
cloud_provider = "aws"
cluster_name = "implementation-studio"
region = "us-west-2"
vpc_cidr = "10.0.0.0/16"
availability_zones = ["us-west-2a", "us-west-2b"]
instance_type = "t3.medium"Step 3: Configure Terraform Variables
cd labs/01-standard-deployment
cp terraform.tfvars.example terraform.tfvarsEdit terraform.tfvars with your provider-specific values (see Step 2).
Step 4: Initialize Terraform
terraform initThis downloads the required providers (Google and/or AWS) and modules.
Step 5: Review Terraform Plan
terraform planReview the resources that will be created:
GCP:
- VPC network and subnets
- GKE cluster
- Artifact Registry
AWS:
- VPC network and subnets
- EKS cluster
- ECR repository
Step 6: Apply Infrastructure
terraform applyThis will take 10-15 minutes. The cluster creation is the longest step.
GCP: GKE cluster creation typically takes 5-10 minutes AWS: EKS cluster creation typically takes 10-15 minutes
Step 7: Get Cluster Credentials
After Terraform completes, get cluster credentials.
GCP
CLUSTER_NAME=$(terraform output -raw cluster_name)
REGION=$(terraform output -raw cluster_location)
PROJECT_ID=$(terraform output -raw project_id || grep project_id terraform.tfvars | cut -d'"' -f2)
gcloud container clusters get-credentials $CLUSTER_NAME \
--region $REGION \
--project $PROJECT_IDAWS
CLUSTER_NAME=$(terraform output -raw cluster_name)
REGION=$(grep -E '^region\s*=' terraform.tfvars | sed 's/.*=\s*"\(.*\)".*/\1/' | tr -d ' ')
aws eks update-kubeconfig \
--region $REGION \
--name $CLUSTER_NAMEOr Use the Helper Script
# The deploy-argo.sh script handles credentials automatically
./scripts/deploy-argo.shVerify access:
kubectl get nodesStep 8: Deploy Argo Workflows
./scripts/deploy-argo.shThis script:
- Detects your provider (GCP or AWS)
- Gets cluster credentials automatically
- Adds Helm repositories
- Creates namespaces
- Installs Ingress NGINX
- Installs Argo Workflows
Step 9: Verify Deployment
./scripts/validate.shCheck that all pods are running:
kubectl get pods -n argo
kubectl get pods -n ingress-nginxStep 10: Get Ingress IP
kubectl get service ingress-nginx-controller -n ingress-nginxNote the EXTERNAL-IP address (or HOSTNAME for AWS).
GCP: Shows an IP address AWS: Shows a hostname (e.g., a1b2c3d4e5f6g7h8.elb.us-west-2.amazonaws.com)
Step 11: Submit a Sample Workflow
kubectl apply -f manifests/sample-workflow.yamlCheck workflow status:
kubectl get workflows -n argo
kubectl describe workflow hello-world -n argoView workflow logs:
kubectl logs workflow/hello-world -n argoStep 12: Access Argo Workflows UI (Optional)
Option 1: Port Forward (Works for Both Providers)
kubectl port-forward -n argo svc/argo-workflows-server 2746:2746Then access: https://localhost:2746
Option 2: Create Ingress (Provider-Specific)
GCP Example:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argo-workflows-ui
namespace: argo
spec:
ingressClassName: nginx
rules:
- host: argo.example.com # Replace with your domain or use IP
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: argo-workflows-server
port:
number: 2746AWS Example:
Same YAML works, but you'll get an AWS ELB hostname. You can also configure a custom domain.
Cleanup
When finished:
./scripts/cleanup.shOr manually:
terraform destroyImportant: Destroying may take 10-15 minutes. Be patient, especially when removing load balancers and clusters.
Troubleshooting
Provider-Specific Steps
See Troubleshooting Guide for provider-specific troubleshooting steps.
Quick Checks
# Check cluster status (GCP)
gcloud container clusters describe $CLUSTER_NAME --region $REGION --project $PROJECT_ID
# Check cluster status (AWS)
aws eks describe-cluster --name $CLUSTER_NAME --region $REGION
# Check nodes
kubectl get nodes -o wide
# Check all resources
kubectl get all -n argo
kubectl get all -n ingress-nginx