Deployment Manager And Monitoring In Google Cloud Platform

In this article, we will learn how to use the Deployment Manager to deploy a VM Instance as well as monitor it in the Google Cloud Platform. If you are new to this series about Google Cloud Platform, I 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).
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Once logged in, you will be redirected to the dashboard of the Google Cloud Platform.
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Step 2
 
Go to APIs & Services, and Cccick on dashboard
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Make sure you Cloud Deployment Manager V2 API, Cloud Runtime Configuration, and Stack Driver Monitoring API are running (If you want to monitor, troubleshoot & improve application performance on your Google Cloud).
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Deployment Manager And Monitoring In Google Cloud Platform
 
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 this. (Please refer here  in order to understand the basic configuration required to create .yaml deployment configuration)
 
Deployment Manager And Monitoring In Google Cloud Platform
Deployment Manager And Monitoring In Google Cloud Platform
 
.yaml file contains the configuration for the VM Instance like VM Name, Type, Zone, Machine Type, etc. as shown in the below image.
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Once everything is configured, mydeploy.yaml will look like as shown below:
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Step 4
 
Run the below command in the Google cloud shell as mentioned below,
 
gcloud deployment-manager deployments create my-first-depl –config mydeploy.yaml
 
Deployment Manager And Monitoring In Google Cloud Platform
 
 --config flag is the relative path to your YAML configuration file. Once the above command has 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.
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Step 5
 
Click on the VM Instance Name, Check the Startup-Script section.
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Let’s edit the startup-scripts in the deployment.yaml config file as shown in the below image,
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Run the below command in order to update the deployment/VM instance.
 
gcloud deployment-manager deployments update my-first-depl –config mydeply.yaml
 
Deployment Manager And Monitoring In Google Cloud Platform
 
Once updated, Visit the VM Instance again, you will see that startup-script under the custom-metadata section is also updated.
 
Deployment Manager And Monitoring In Google Cloud Platform
 

Monitoring of Google Cloud Services

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


Similar Articles