Infrastructure repository for Project Garden
- aws-cli [install, quick setup, docs]
- gcloud cli [install, quick setup, docs]
- kubectl [install, docs]
- terraform [install, docs]
- minikube(
dev
) [install, docs]
- Get AWS Access Key and Secret Key from
Google Secret Manager
export AWS_ACCESS_KEY_ID=$(gcloud secrets versions access 2 --secret=project-garden-terraform-secret-key | jq -r '.[0].ACCESS_ID')
export AWS_SECRET_ACCESS_KEY=$(gcloud secrets versions access 2 --secret=project-garden-terraform-secret-key | jq -r '.[0].SECRET_KEY')
- Start Terraform
terraform init
terraform apply
- Cleanup
# 🚨 Make sure to delete all k8s ervices
# 🚨 and deployments before proceed to Clean Up.
# 🚨 Otherwise, terraform cannot complete de destroying process
terraform destroy
- Configure
kubectl
# Define your AWS CLI Profile
PROFILE=your_aws_cli_profile
# Accessing Cluster Credential
aws eks update-kubeconfig \
--region $(terraform output -raw region) \
--name $(terraform output -raw cluster_name) \
--profile $PROFILE
# Verify
kubectl cluster-info
Other way to create learning cluster is using minikube
.
# Start a cluster with version 1.24.9
# (Required for current istio version)
minikube start --kubernetes-version=v1.24.9
# Create a tunnel to bridge beetwen local <-> minikube cluster
# DON'T CLOSE THE TERMINAL!
minikube tunnel
# All private key is located in .private folder (learning-cluster/infrastructure/.private)
chmod 400 .private/hello_world_vm.pem
ssh -i .private/hello_world_vm.pem ubuntu@$(terraform output -raw ec2_instance_public_ip)
- You can find the troubleshoot result in troubleshoots