0
0
GCPcloud~5 mins

Cloud service models (IaaS, PaaS, SaaS) in GCP - Commands & Configuration

Choose your learning style9 modes available
Introduction
Cloud service models help you choose how much control you want over your computing resources. They solve the problem of managing hardware and software by offering different levels of responsibility and ease.
When you want to rent virtual machines and manage your own software on them.
When you want to deploy your app without worrying about the underlying servers.
When you want to use ready-made software like email or storage without installing anything.
When you want to focus on coding and not on infrastructure setup.
When you want to quickly scale your app without buying physical hardware.
Commands
This command creates a virtual machine in Google Cloud, showing how Infrastructure as a Service (IaaS) works by giving you control over the server.
Terminal
gcloud compute instances create example-vm --zone=us-central1-a --machine-type=e2-medium
Expected OutputExpected
Created [https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/example-vm]. NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS example-vm us-central1-a e2-medium 10.128.0.2 34.68.123.45 RUNNING
--zone - Specifies the location where the VM will run.
--machine-type - Defines the hardware resources for the VM.
This command deploys an app to Google App Engine, demonstrating Platform as a Service (PaaS) where you focus on your app code and Google manages servers.
Terminal
gcloud app deploy app.yaml --project=my-project
Expected OutputExpected
Services to deploy: descriptor: 'app.yaml' Beginning deployment... Updating service [default]... Deployed service [default] to [https://my-project.uc.r.appspot.com] You can stream logs from the command line by running: gcloud app logs tail -s default
--project - Specifies the Google Cloud project to use.
This command enables the Gmail API, an example of Software as a Service (SaaS) where you use Google's ready-made software without managing infrastructure or code.
Terminal
gcloud services enable gmail.googleapis.com --project=my-project
Expected OutputExpected
Operation "operations/enablement-1234567890" finished successfully.
--project - Specifies the Google Cloud project to enable the service for.
Key Concept

If you remember nothing else, remember: IaaS gives you servers, PaaS gives you a platform to run apps, and SaaS gives you ready-to-use software.

Common Mistakes
Trying to deploy app code directly on IaaS without setting up the environment.
IaaS provides raw servers, so you must install and configure software yourself.
Use PaaS for easier app deployment or prepare the server environment manually on IaaS.
Assuming SaaS services can be customized like your own app code.
SaaS is managed software with limited customization options.
Use SaaS for standard software needs and PaaS or IaaS for custom apps.
Summary
Use 'gcloud compute instances create' to launch virtual machines (IaaS).
Use 'gcloud app deploy' to deploy apps on managed platforms (PaaS).
Use 'gcloud services enable' to activate ready-made software APIs (SaaS).