Sunday, 27 September 2020

Deployment Manager and Monitoring in Google Cloud Platform

In this article, we will learn How to use the Deployment Manager to deploy VM Instance as well as monitor them in the Google Cloud Platform. If you are new to this series of Google Cloud Platform, I will recommend you to go through the below articles of this series:


Let’s Begin:
Step 1:
Log in to the Google Cloud Platform by visiting https://console.cloud.google.com/ (Google provides $300 as a free trial, but for that, you need to link your credit card).
Once logged in, you will be redirected to the dashboard of the Google Cloud Platform.
Step 2:
Go to APIs & Services, And Click on Dashboard
Make sure Cloud Deployment Manager V2 API, Cloud Runtime Configuration, Stack Driver Monitoring API (If you want to monitor, troubleshoot & improve application performance on your Google Cloud)




Step 3:
Click on the Google Cloud Shell icon and Create a .yaml file (named It as mydeploy.yaml). You can use nano editor in order to do the same. (Please refer to https://cloud.google.com/deployment-manager/docs/configuration/create-basic-configuration link in order to understand the basic configuration required to create .yaml deployment configuration)

.yaml file contains the configuration for the VM Instance like VM Name, Type, Zone, Machine Type, etc. as shown in the below image.
Once everything is configured, mydeploy.yaml will look like as shown below
Step 4:
Run the below command in google cloud shell as mentioned below:
gcloud deployment-manager deployments create my-first-depl –config mydeploy.yaml
--config flag is the relative path to your yaml configuration file. Once the above command executed successfully, a list with the resource name mentioned in the yaml file and its state will be shown to the user. We can also check the VM Instances in the Compute Engine menu as shown in the below image.

Step: 5
Click on the VM Instance Name, Check the Startup-Script section. 
Let’s edit the startup-scripts in the deployment.yaml config file as shown in the below image:

Run the below command in order to update the deployment/VM instance
gcloud deployment-manager deployments update my-first-depl –config mydeply.yaml
Once updated, Visit the VM Instance again, you will see that startup-script under the custom-metadata section is also updated.

Monitoring of Google Cloud Services:
Step 1:
Click on the Overview submenu of the Monitoring menu.
Then click on View GCE Dashboard as shown in the below image:
Check Monitoring Agent Status, in case of not detected, Install Agent by clicking on the Install Agent button.
You can track CPU Utilization, Received & send bytes, etc.
I hope this will article help you in getting the basic understanding of Deployment Manager and Monitoring tools in Google Cloud Platform.
Thanks



0 comments:

Post a comment

Subscribe Now

Popular Posts

Contact us

Name

Email *

Message *

Subscribe us on YouTube

Like us on Facebook

Follow us on Google+