Google Cloud Platform VPC - Part1

       A Virtual Private Cloud is an isolated or private space with in the cloud platform. Unlike other cloud providers Google Cloud Platform VPC is global resource and it can span across multiple regions. Google has done massive investment to build its own network infrastructure. Google has its own high bandwidth submarine fiber optic networks connecting across the globe.

Below figures is a very high level architecture of Google Cloud Platform VPC.



1.) Google Cloud Platform VPC can span across multiple regions.
2.) A subnet is a regional resource and it cannot span regions.
3.) Subnet can span across zones.
4.) A subnet IP space can be expanded without any shutdown or downtime.







gcloud - Google Cloud command line Interface - Part -1


gcloud is a command-line interface to Google Cloud Platform. it is part of Google Cloud SDK.

Below are some basic usage.

1.) Getting help on commands.


VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud --help

VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud compute --help

2.) To Know the versions.

VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud version

Google Cloud SDK 206.0.0
bq 2.0.34
core 2018.06.18
gsutil 4.32
kubectl 

3.) To understand the Cloud SDK properties of active configuration.

VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud config list
[compute]
region = us-east1
zone = asia-east1-a
[core]
account = xxxxxxxx@gmail.com
disable_usage_reporting = False
project = techproj-208207

Your active configuration is: [default]

4.)  To know installed components.

VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud components list

Your current Cloud SDK version is: 206.0.0
The latest available version is: 210.0.0




4a.)To install or remove components at your current SDK version [206.0.0], run:
  
$ gcloud components install COMPONENT_ID
$ gcloud components remove COMPONENT_ID

4b.)To update your SDK installation to the latest version [210.0.0], run:

$ gcloud components update


5.)  To get the info of current gcloud environment.

VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud info
Google Cloud SDK [206.0.0]

Platform: [Linux, x86] uname_result(system='Linux', node='molus-VirtualBox', release='4.15.0-23-generic', version='#25-Ubuntu SMP Wed May 23 17:59:24 UTC 2018', machine='i686', processor='i686')
Python Version: [3.6.5 (default, Apr  1 2018, 05:46:30)  [GCC 7.3.0]]
Python Location: [/usr/bin/python3]
Site Packages: [Disabled]

Installation Root: [/opt/google-cloud-sdk]
Installed Components:
  core: [2018.06.18]
  bq: [2.0.34]
  gsutil: [4.32]
  kubectl: []
System PATH: [/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin]
Python PATH: [/opt/google-cloud-sdk/lib/third_party:/opt/google-cloud-sdk/lib:/usr/lib/python36.zip:/usr/lib/python3.6:/usr/lib/python3.6:/usr/lib/python3.6/lib-dynload]
Cloud SDK on PATH: [False]
Kubectl on PATH: [/usr/local/bin/kubectl]

WARNING: There are old versions of the Google Cloud Platform tools on your system PATH.
  /usr/local/bin/kubectl

Installation Properties: [/opt/google-cloud-sdk/properties]
User Config Directory: [/home/molus/.config/gcloud]
Active Configuration Name: [default]
Active Configuration Path: [/home/molus/.config/gcloud/configurations/config_default]

Account: [xxxxxxxxx@gmail.com]
Project: [techproj-208207]

Current Properties:
  [compute]
    zone: [asia-east1-a]
    region: [us-east1]
  [core]
    account: [pvnambiar@gmail.com]
    disable_usage_reporting: [False]
    project: [techproj-208207]

Logs Directory: [/home/molus/.config/gcloud/logs]
Last Log File: [/home/molus/.config/gcloud/logs/2018.08.07/12.46.35.767978.log]

git: [b'git version 2.17.1']
ssh: [b'OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017']



6.) List available regions.


7.) To get the description of region.

VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud compute regions

describe asia-east1
creationTimestamp: '1969-12-31T16:00:00.000-08:00'
description: asia-east1
id: '1220'
kind: compute#region
name: asia-east1
quotas:
- limit: 24.0
  metric: CPUS
  usage: 0.0
- limit: 4096.0
  metric: DISKS_TOTAL_GB
  usage: 0.0
- limit: 8.0
  metric: STATIC_ADDRESSES
  usage: 0.0
- limit: 8.0
  metric: IN_USE_ADDRESSES
  usage: 0.0
- limit: 500.0
  metric: SSD_TOTAL_GB
  usage: 0.0
- limit: 6000.0
  metric: LOCAL_SSD_TOTAL_GB
  usage: 0.0
- limit: 100.0
  metric: INSTANCE_GROUPS
  usage: 0.0
- limit: 50.0
  metric: INSTANCE_GROUP_MANAGERS
  usage: 0.0
- limit: 240.0
  metric: INSTANCES
  usage: 0.0
- limit: 50.0
  metric: AUTOSCALERS
  usage: 0.0
- limit: 20.0
  metric: REGIONAL_AUTOSCALERS
  usage: 0.0
- limit: 20.0
  metric: REGIONAL_INSTANCE_GROUP_MANAGERS
  usage: 0.0
- limit: 0.0
  metric: PREEMPTIBLE_CPUS
  usage: 0.0
- limit: 0.0
  metric: NVIDIA_K80_GPUS
  usage: 0.0
- limit: 0.0
  metric: COMMITMENTS
  usage: 0.0
- limit: 200.0
  metric: INTERNAL_ADDRESSES
  usage: 0.0
- limit: 0.0
  metric: NVIDIA_P100_GPUS
  usage: 0.0
- limit: 0.0
  metric: PREEMPTIBLE_LOCAL_SSD_GB
  usage: 0.0
- limit: 0.0
  metric: PREEMPTIBLE_NVIDIA_K80_GPUS
  usage: 0.0
- limit: 0.0
  metric: PREEMPTIBLE_NVIDIA_P100_GPUS
  usage: 0.0
- limit: 0.0
  metric: NVIDIA_V100_GPUS
  usage: 0.0
- limit: 0.0
  metric: PREEMPTIBLE_NVIDIA_V100_GPUS
  usage: 0.0
- limit: 16.0
  metric: INTERCONNECT_ATTACHMENTS_PER_REGION
  usage: 0.0
- limit: 80000.0
  metric: INTERCONNECT_ATTACHMENTS_TOTAL_MBPS
  usage: 0.0
- limit: 5.0
  metric: RESOURCE_POLICIES
  usage: 0.0
- limit: 20.0
  metric: IN_USE_BACKUP_SCHEDULES
  usage: 0.0
selfLink: https://www.googleapis.com/compute/v1/projects/techproj-208207/regions/asia-east1
status: UP
zones:
- https://www.googleapis.com/compute/v1/projects/techproj-208207/zones/asia-east1-a
- https://www.googleapis.com/compute/v1/projects/techproj-208207/zones/asia-east1-b
- https://www.googleapis.com/compute/v1/projects/techproj-208207/zones/asia-east1-c


8.) To get the list of route.



9.) To get the description of routes.

VirtualBox:~/mybox/kubernetes/server/bin$ sudo gcloud compute routes describe default-route-0a7057a5d9a20883
creationTimestamp: '2018-06-24T02:27:19.128-07:00'
description: Default local route to the subnetwork 10.140.0.0/20.
destRange: 10.140.0.0/20
id: '6428811225324510488'
kind: compute#route
name: default-route-0a7057a5d9a20883
network: https://www.googleapis.com/compute/v1/projects/techproj-208207/global/networks/default
nextHopNetwork: https://www.googleapis.com/compute/v1/projects/techproj-208207/global/networks/default
priority: 1000
selfLink: https://www.googleapis.com/compute/v1/projects/techproj-208207/global/routes/default-route-0a7057a5d9a20883


Google Cloud Platform - Compute Options















 

App Engine

App Engine is a fully managed serverless application platform to build and deploy applications. Developer don’t have to worry about the infrastructure or server management, rather he can fully focus on his development activities.

Compute Engine

Compute Engine is Google Cloud Platform’s IaaS offering which is built on Google’s global infrastructure which powers gmail, youtube etc.

Kubernetes Engine

Google Kubernetes Engine is a managed and production ready environment for containerized application.

Cloud Function

Cloud Function is a serveless platform for developers to run and scale code in cloud. It enables to create serverless event-driven applications

Cloud Run

Cloud Run enables to stateless workloads without worrying about provisioning, configuring or managing a server.

AWS Virtual Private Cloud - Part2




Virtual Private Cloud

Virtual Private Cloud is a logically isolated section of AWS cloud where you can launch your resources. You have complete control of your virtual networking environment. You can create your own subnets and select even your preferred private IP ranges. VPC can span multiple availability zone in the same region but VPC can not span multiple regions.

Internet Gateway

An Internet Gateway provide access to internet for your instances in VPC. Internet Gateway is redundant and highly available. Only one Internet Gateway can be attached to a VPC at a time.
Since Internet Gateway is horizontally scaled you don’t need to worry about single point of failure.

Subnets

You can create your own customized subnets in a VPC and assign the preferred private IP address range. A subnet can not span multiple availability zone.

Route Table

A Route Table contains set of rules which determines the direction of traffic. Each subnet in your VPC must have a route table. A subnet can associate only one route table but multiple sublets can associate same route table.

Network Access Control List

Network Access Control List is nothing but a firewall which controls inbound and outbound traffic of one or more subnets. A Network Access Control List can be attached to multiple subnets but a subnet can associate only one Network Access Control List, If you asscociate a second one, previous association will be removed. Network Access Control List permits “allow” and “deny” traffic and it is stateless.

Security Group

Security Group contains set of rules which controls inbound and outbound traffic of an EC2 instance.Security Group permits only “allow” rules and it is stateful


AWS - Virtual Private Cloud - Part1


Figure shown below is a very high level architecture diagram of an AWS Virtual Private Cloud (VPC)


Basic characteristics of an AWS VPC
-------------------------------------------------------------  
By default an AWS account can contain only 5 VPCs
VPC can't span across AWS regions.
VPC can span across multiple availability zone in the same region.
VPC can contain multiple subnets provided the CIDR is not overlapping.

AWS Services - Compute


Below are the compute services provided by AWS.





EC2 – Elastic Cloud Compute

EC2 is a webservice for compute capacity which can be provisioned based on your needs. Its basically a re-sizable virtual machine which can be utilized for various compute operations, hosting web applications etc.

Lightsail

AWS Lighsail provides the required infrastructure to deploy and manage websites, web applications and databases quickly and easily in cloud.

ECR – Elastic Container Registry

Elastic Container Registry is a highly available, secure and fully managed container repository provided by AWS to store container images. Its similar to github.

ECS – Elastic Container Service

Elastic Container Service is AWS provided platform for deploying managing and scaling docker containers. It is integrated with familiar AWS services like ELB, EBS, Security Groups & IAM roles.

EKS - Elastic Kubernetes Service.

Elastic Kubernetes Service is fully managed Kubernetes platform which you can provision and use.

Lambda

Lambda is AWS provided serverless architecture. You can place your code and trigger the code based on an event Lambda will run the code for you and you have to pay only for the compute time which your code consumes. Basically there is no change for the idle time of the code.

Batch

Batch is an AWS provided service to run you Batch workloads efficiently using EC2.

Elastic Beanstalk

Elastic Beanstalk is an AWS provided service for deploying applications. Applications can be easily deployed, monitored and scaled using Elastic Beanstalk.

Serverless Application Repository

AWS Serverless Application Repository is a powerful repository which enables to store and share reusable serverless applications.