Learn Google Cloud Platform (GCP) – Step by Step Guide
What is Google Cloud?
Google Cloud Platform (GCP) is a set of products and services which allow building applications on Google’s software and infrastructure. It is a set of solutions and products that can help you solve your toughest business challenges. Instead of p even when you don’t need them, You can use GCP for performing the tasks like backing up data, storing data huge amount of structured as well as unstructured data, server management and provisioning, application development etc instead of your on-premise server. You need not pay extra for the servers and provision the virtual instances for the above mentioned tasks at lower prices with the feature to scale the infrastructure up or down.
GCP provides Infrastructure as a service, Platform as a service, and Serverless computing environments. Google announced App Engine in April 2008, which was the first cloud computing service offered by the company. The service became generally available in November 2011. It is a platform for developing and hosting web applications in Google-managed data centres. Since then, Google has added multiple cloud services to the platform.
Some of the most popular ones are:
-
Google App Engine
Platform as a service which allows developing web applications in Python, Java, Go, PHP and manages everything for you (database, deployment, scaling, software…). There is daily free quota and you pay for what you use. Drawback is that you are limited with third party software.
-
Google Compute Engine
Infrastructure as a service allows you to a wide range of possibilities when creating virtual machines, selection of OS, CPU, RAM memory and hard disk space so depending on your needs you can adjust it and use it.
-
Google Cloud Storage
service for storing files and sharing on the internet (like images, videos, documents) with high availability and performance.
Step 1 – Create a GMAIL account
- Go to https://accounts.google.com/signup/v2/webcreateaccount?flowName=GlifWebSignIn&flo wEntry=SignUp to create a new gmail account
- You may also opt to use your existing Gmail account
- Fill in the details and click next
- Add your mobile number and verify using verification code
- Add details about your recovery address, data of birth and Gender
- Once account setup is complete – go to https://mail.google.com/mail/u/0/
- Login as your new account
- Click Next
- In the next page, click – Yes, I’m in
- In the next page, agree to the T&C
Step 2 – Log in to GCP console
- On your browser (preferably chrome), navigate to https://console.cloud.google.com
- Agree the terms and conditions and you now have a free tier account for GCP
Step 3 – Enable Billing to receive $300 credits
- On top of your screen you will see the link to enable billing
- Click on the Activate Button to go to the next page
- In the next page – select your country and Agree to the T&C and click Continue
In the next page –
- Change account type to – Individual
- Select your Tax status type
- Add your Address
- Add details about your registered ID like SSN/PAN etc
- Add credit card details
NOTE – It is YOUR responsibility to ensure that you shut down your GCP resources so that you dont incur unnecessary charges. Google provides you with an evaluation credit of $300, upto which you will not be charged. Once you cross the limit of $300 Google will charge you for the resources that you utilize. All cloud providers has the PAY AS YOU GO model, which ensures that you are charged only for the resources that you are utilizing.
NOTE – Ensure that your card supports auto debit. I have seen a few instances where debit cards were rejected as they dont support auto debit.
- Once done – click Start My Free Trial
Step 4 – Create a new project
- The top blue menu bar has an option of Select a project
- Click on Select a project dropdown
- By default a new project would be created
- Select the project My first project and you are good to go.
NOTE – Google Cloud Projects provides a good way to bundle all your resources together. Which means that deleting the project entirely will delete all the resources inside it. This is really helpful when you dont remember what resources have been created and what resources are getting billed. Deleting the project completely will ensure that you are not billed for anything.
Create UBUNTU VM Instance
- Once after setting project successfully & enabled the billing for it.
- On your google cloud home page, top left corner click 3dash symbol as shown below
- You will see various services offered by google.
- Now scroll down list of services until you see “Compute Engine” then click on it
- It will pop up with various other services under compute engine as show below
- Now click on “VM Instances”
- After clicking on VM Instances it will show below screen
- Now Click on CREATE INSTANCE above to create a new instance.
After clicking on “CREATE INSTANCE” it will show below screen
- Name: “type any name” (ex: machine1)
- Series: N1 (do not change this)
- Machine type: (choose the appropriate capacity as per the requirement)
Scroll down for other options such As:
- Boot disk: click on change (now you will see other screen like below right side)
- Operation system: choose Ubuntu
- Version: Ubuntu 18.04LTS
- Boot disk type: leave the default
- Size: leave the default
Then click on “select” at the bottom
Now you should see as below left side Boot disk section shows
Ubuntu
Identity and API access Section:
- Service account: Compute Engine default service account (default)
- Access scopes: Allow default access (default)
Now click on “create” at the bottom.
- Once we click on create you will see below screen.
- The machine will get ready in couple of minutes & you will see as below highlighted.
- To login to the machine click on SSH – open in browser window.
- To create more VMs, repeat same process
Open Port from VPC Networks
Step 1: On the navigation menu on the left, scroll down and go to Networking section -> VPC network – > VPC networks.
Step 2: Go to firewall details and click on the default-allow-http.
Step 3: Click on the Edit link.
Step 4: Choose All instances in the network from the Targets dropdown.
Step 5: Source filter should be selected to IP ranges.
Step 6: Select Allow all from Protocols and ports and click save.
Step 7: Once the rule is saved, you will view this screen.
Run Commands on the Ubuntu VM
Step 1: Go to Compute Engine->VM instances from the navigation menu. You will see the VM instance we created earlier.
Step 2: Now, select Open in browser window from the Connect dropdown.
Step 3: You will see a new window like the one below. It may take a few seconds to connect to the VM.
Step 4: Once the connection is done, this screen opens.
Step 5: Now, we will run the command sudo apt-get update.
Sudo is the command to get admin rights temporarily on the VM. We will get the software package update by executing the above command.
Step 6: Once the command is executed and update completes, you should view the below screen.
Step 7: Now, we will install JDK 8 on the VM with the command:
sudo apt-get install software-properties-common && \ sudo add-apt-repository ppa:webupd8team/java -y && \ sudo apt-get update && \ sudo apt-get install oracle-java8-installer -y && \ sudo apt-get install oracle-java8-set-default
Step 8: Once the command is executed, we run the java -version command to check the version of JDK installed.
Step 9: Now, we will install Maven on the VM with the following command:
sudo apt-add-repository ppa:andrei-pozolotin/maven3 && \ sudo apt-get update && \ sudo apt-get install maven
Now, the VM is ready with JDK and Maven installed.
Setup Firewall rules, for applications access on VMs
- On your google cloud home page, top left corner click 3dash symbol as shown below,
- You will see various services offered by google.
- Now scroll down list of services until you see “VPC network” then click on it
- It will pop up with various other services under compute engine as show below
- Now click on “Firewall rules”
- After clicking on Firewall rules it will show below screen
- Now Click on CREATE FIREWALL RULE above to create a New rule.
- Now you will see below screen follow the setting as highlighted in screenshot below
- And click on Create Option at the bottom.
Now you will see below screen, this setting will enable the all traffic to all VM instances in the default network.
Summary
Topics Covered
In this tutorial, we tried to decode the terms – Cloud and GCP. We
covered about the fundamental concepts of Cloud Computing –
characteristics, advantages/disadvantages and the types of Cloud
Computing. We also came to know about the major cloud providers in
the market. Then, we discussed GCP – major products it offers and
why we should learn GCP. We learnt the steps to sign up for a free
GCP account, how to create a VM instance and connect to it.
Road Ahead
I hope you enjoyed reading this document. This basic tutorial on
Cloud Computing and GCP will help all the professionals in their
career paths to gain expertise on GCP by further exploration. GCP is
a huge topic with so much to offer– one should definitely deep dive
into it to understand it in more detail. This document will act as
the first step in this insightful journey.
0 Comments