GCP 16 Apr Ref
GCP 16 Apr Ref
---------------------------
- cloud computing refers to IT services i.e. compute, databases,
storage, networks, security etc.
IAAS
- the service provider offers virtualized hardware or computing
infrastrcuture
- VM, volumns, etc.
PAAS
- offers application platforms and tools over the cloud which
enables application development
SAAS
- offers a software or applications as service, these
applications are ready to use, hosted on provider's infra
Cloud Providers
-----------------------
- AWS
- Azure
- GCP
GCP Infrastructure
---------------------------
- Region
- geographical area
- 22
- Zone
- actual data center
- zone is the actual deployment area
Project
-------------
- all resources are tied up with a project
- a project helps to segragate the resources i.e. users, billing, vms,
storage buckets in logical manner
5. Mobile app
- Compute
- Networking
- Management
- CI/CD tools
- .....
Compute Engine
-------------------------
- abstracts the underlying hardware
- create VMs using this service with specific machine type / storage /
firewall rules etc.
- specify region / zone
- specify OS using machine image
-
- VM
- region/zone
- machine type - vCPU & RAM
- a boot disk
- additional disks if required
- network interface
- firewall rules
Persistent Disk
---------------------------
- Standard Persistent Disk
- Machine Image
- it is compute engine resource that stores all the configuration,
metadata, permissions and data from one or more disk required to
create vm
- source = instance
- Snapshot
- reflects the contents of the persistent disk
- backup data from a disk
- smaller size than image size (caz they do not contain OS)
- differential backups
- snapshots can be shared between project
- can be created for running disk
- source = a disk
- Image
- same as snapshot, but includes OS and boot loader
- source = a disk
- can't be created on running disk
- Instance Template
- it is a template for configuration of a VM Instance
- specify machine type, boot disk, additional disks, image, firewall,
other property
#! /bin/bash
apt-get update
apt-get install apache2 -y
a2ensite default-ssl
a2enmod ssl
vm_hostname="$(curl -H "Metadata-Flavor:Google" \
http://169.254.169.254/computeMetadata/v1/instance/name)"
echo "Page served from: $vm_hostname" | \
tee /var/www/html/index.html
- Instance Group
---------------------
- collection/group of multiple vm instances
- autohealing
- we can setup health checks, if it fails, MIG will
recreate the instance
- load balancing
- distribute the traffic accross all the instances
- load balancing
- distribute the traffic accross all the instances