GCP Classroom Series – 20/Mar/2021

Creating a instance template with tomcat application

  • Lets create a image with tomcat application
  • Create a ubuntu 18.04 instance and execute the following commands
sudo apt update
sudo apt install openjdk-8-jdk -y
 sudo apt install tomcat8 tomcat8-admin tomcat8-common  tomcat8-docs tomcat8-user -y
 cd /tmp
 wget https://referenceappkhaja.s3-us-west-2.amazonaws.com/gameoflife.war
 sudo cp /tmp/gameoflife.war /var/lib/tomcat8/webapps/gameoflife.war
  • Now access the application htpp://publicip:8080/gameoflife Preview
  • Now lets try to create a image Preview
  • Once the image is created , lets create an instance template Preview
  • Ensure you have healthcheck created Preview
  • From instance template try to create instance group with minimum 2 instance and max 5 instances Preview
  • Wait for the instance template to be launched and the health checks to be successful Preview
  • Lets create a loadbalancer with http protocol
    • frontend => http port 80
    • backend => game of life group http port 8080 Preview Preview Preview Preview Preview


  • Try to create instance template in such a way that your instances will not have public/external ip address
  • Then create a load balancer
  • This is given as an exercise as in reality we will not create our vms with external ips which are part of instance-group and running our production applications.


  • We have been creating instance templates and instance groups from google console
  • We need to find the automation options around it

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin