Execute the commands below to prepare the AWS and GCP environment
chmod +x *.shmkdir -p ~/.aws/touch ~/.aws/credentials_multiclouddeploy
Creating the Access Key for the terraform-en-1 user using the IAM service and rename it as key.csv and upload it to GCP
./aws_set_credentials.sh key.csv
GOOGLE_CLOUD_PROJECT_ID=$(gcloud config get-value project)
gcloud config set project $GOOGLE_CLOUD_PROJECT_ID
mkdir -p ~/.aws/touch ~/.aws/credentials_multiclouddeploy./aws_set_credentials.sh key.csvGOOGLE_CLOUD_PROJECT_ID=$(gcloud config get-value project)Execute the command below to set the project in the Google Cloud Shell
gcloud config set project $GOOGLE_CLOUD_PROJECT_ID
./gcp_set_project.shExecute the commands to enable the Kubernetes, Container Registry, and Cloud SQL APIs
gcloud services enable containerregistry.googleapis.comgcloud services enable container.googleapis.com
gcloud services enable sqladmin.googleapis.com
gcloud services enable cloudresourcemanager.googleapis.com
gcloud services enable serviceusage.googleapis.com
gcloud services enable compute.googleapis.com
gcloud services enable servicenetworking.googleapis.com --project=$GOOGLE_CLOUD_PROJECT_ID
Execute the following commands to provision infrastructure resources
cd ~/mission1/en/terraform/terraform initterraform planterraform applymysql --host=**<replace_with_public_ip_cloudsql>** --port=3306 -u app -p
Once you're connected to the database instance, create the products table for testing purposes
use dbcovidtesting;
source ~/application/db/create_table.sql
show tables;
exit;
Enable Cloud Build API via Cloud Shell.
GOOGLE_CLOUD_PROJECT_ID=$(gcloud config get-value project)
cd application/app
gcloud builds submit --tag gcr.io/$GOOGLE_CLOUD_PROJECT_ID/luxxy-covid-testing-system-app-en
GOOGLE_CLOUD_PROJECT_ID=$(gcloud config get-value project)
cd application/app
gcloud builds submit --tag gcr.io/$GOOGLE_CLOUD_PROJECT_ID/luxxy-covid-testing-system-app-en
Open the Cloud Editor and edit the Kubernetes deployment file (*.yaml) and update the variables with your
<PROJECT_ID>on the Google Container Registry path- AWS Bucket name, AWS Keys (open file access key cvs file and use Access key ID and Secret access key)
- Cloud SQL Database Private IP.
cd application/kubernetes/
luxxy-covid-testing-system.yaml
image: gcr.io/<PROJECT_ID>/luxxy-covid-testing-system-app-en:latest
- name: AWS_BUCKET
value: "luxxy-covid-testing-system-pdf-en-xxxx"
- name: S3_ACCESS_KEY
value: "xxxxxxxxxxxxxxxxxxxxx"
- name: S3_SECRET_ACCESS_KEY
value: "xxxxxxxxxxxxxxxxxxxx"
- name: DB_HOST_NAME
value: "xxxxxxxx"Connect to the GKE (Google Kubernetes Engine) cluster via Console
Deploy the application Luxxy in the Cluster
cd application/kubernetes
kubectl apply -f *.yaml
- Connect to Google Cloud Shell
- Download the dump using wget
- Connect to MySQL DB running on Cloud SQL
mysql --host=**<replace_with_public_ip_cloudsql>** --port=3306 -u app -p
Import the dump on Cloud SQL
use dbcovidtesting;
source dump/db/db_dump.sql
Check if the data got imported correctly
select * from records;
exit;
Connect to the AWS Cloud Shell and sync your data with s3 bucket
aws s3 sync . s3://**link to s3 bucket**
- Destroy the deployment
kubectl delete deployment luxxy-covid-testing-system- Destroy the cluster
kubectl delete service luxxy-covid-testing-system