What is Serverless way of deploying a application?

Satya131113
2 min readJul 4, 2021

Every application needs a server for sure to run. What server-less means is one need not worry about the server configurations for deploying the application. One can focus on the application and the cloud platform’s Serverless service will take of maintaining the underlying hardware configurations and health ensuring the application’s availability for the end user.

Cloud Functions is one of many server-less services provided my Google Cloud Platform. A cloud functions uses a event occurrence as trigger for running a application.This way we can use GCP Services to create and manage VMs for running the application. This also helps one to pay for only what is utilised.

How do I create a cloud function in GCP?

Step 1: Create a GCP billing account, a project in it and open the project in GCP console.

Step 2: Navigate to Cloud Functions API and enable it.

Step 3: Click create Cloud Function and enter the configuration. We can specify different trigger events for the cloud function.

Step 4: We can also specify the max number of servers, VPC Network, Add Service Accounts,etc.

Step 5: Click save and next.

Step 6: Select the Runtime in which you want to create the application, the main method to call to run the application. Here I am using Python3.8 for my application.

Step 7: Create the application or upload the existing application either as a zip file or from a cloud repository.

Step 8: Deploy the application and test it by creating the trigger event.

Step 9: The logs of the cloud functions can be checked by navigating to the cloud cloud function created in google cloud console.

We can also create a cloud function from local machine using Google Cloud SDK.

Setup the SDK and complete the application, navigate to the directory in which the application is present.Run the following command

gcloud functions deploy Cloud_Function_Name — runtime runtime_name— trigger-resource resource_details— trigger-event google.trigger_event

This gives the latest 50 logs from the cloud functions in a text file

gcloud functions logs read — limit 50 > log.txt

--

--