This solution assumes you already have a project created and set up where you wish to host these resources.
Time to complete: About 20 minutes
Click the Start button to move to the next step.
- Have an organization set up in Google cloud.
- Have a billing account set up.
- Have an existing project with billing enabled.
In order to spin up this architecture, you will need to be a user with the “Project owner” IAM role on the existing project:
Note: To grant a user a role, take a look at the Granting and Revoking Access documentation.
Before we deploy the architecture, you will need the following information:
- The project ID
Once the repository is cloned please run the following command to install the prerequisistes:
sh prereq.shYou will then be prompted to provide the project-id for the destination project.
After this is complete, you can kick off the Cloud Build pipeline with the following command:
gcloud builds submit . --config cloudbuild.yamlIf you encounter errors when running these commands, please attempt to run them again in a clean project.
At this point you should have successfully deployed the foundations for a Three Tier Web Application!.
This process may take a while to deploy, please do not close the window when deploying.
Next we are going to test the architecture and finally clean up your environment.
After you deployed the solution, you can check the resources created and see how they work together.
First, go to Google Kubernetes Engine and click on the created Cluster.
You can see all the details of you applications in Workloads menu
Then, go to Cloud Load Balancing and click on the frontend Load Balancer
You can see all the details of the Load Balancer, and you can copy the Frontend IP section to access the application.
Finally, if you paste the ip and enter in your browser, you see the example application
Execute the command below on Cloud Shell to destroy the resources.
gcloud builds submit . --config cloudbuild_destroy.yaml
The above command will delete the associated resources so there will be no billable charges made afterwards.
You’re all set!