Giter Club home page Giter Club logo

gcp's Introduction

The Google Cloud Developer's Cheat Sheet

Google Cloud Developer's Cheat Sheet Poster Image
White background: Poster PDF | Brochure PDF | High-resolution PNG | Medium-res PNG | Low-res PNG
Dark background: Poster PDF | Brochure PDF | High-resolution PNG | Medium-res PNG | Low-res PNG

Desktop Wallpapers: 16:9 (iMac, etc.) | 16:10 (Macbook Pro) | 4:3 (Older computers) | 3:2 (Pixelbook)

Text descriptions with links are below

Suggestions for better descriptions? Missing products? Pull requests are welcome on README.md (this file).

Feedback? @aslamlatheef


All Products

πŸ”—-Product page πŸ“„-Documentation

Compute

Storage

Database

Data and Analytics

AI/ML

Networking

  • Carrier Peering: Peer through a carrier πŸ“„
  • Direct Peering: Peer with GCP πŸ“„
  • Dedicated Interconnect: Dedicated private network connection πŸ“„
  • Partner Interconnect: Connect on-prem network to VPC πŸ“„
  • Cloud Armor: DDoS protection and WAF πŸ”— πŸ“„
  • Cloud CDN: Content delivery network πŸ”— πŸ“„
  • Cloud DNS: Programmable DNS serving πŸ”— πŸ“„
  • Cloud Load Balancing: Multi-region load distribution πŸ”— πŸ“„
  • Cloud NAT: Network address translation service πŸ“„
  • Cloud Router πŸ†•: VPC/on-prem network route exchange (BGP) πŸ“„
  • IPsec VPN: Virtual private network connection πŸ“„
  • Network Service Tiers: Price vs performance tiering πŸ”— πŸ“„
  • Network Telemetry: Network telemetry service πŸ”— πŸ“„
  • Traffic Director πŸ†•: Service mesh traffic management πŸ”— πŸ“„
  • Google Cloud Service Mesh πŸ†•: Service-aware network management πŸ”— πŸ“„
  • Virtual Private Cloud: Software defined networking πŸ”— πŸ“„

Internet of Things (IoT)

Identity and Security

Management Tools

Developer Tools

Migration to GCP

  • Cloud Data Transfer: Data migration tools/CLI πŸ”—
  • Google Transfer Appliance: Rentable data transport box πŸ”— πŸ“„
  • Cloud Storage Transfer Service: Cloud to cloud transfers πŸ“„
  • BigQuery Data Transfer Service: Bulk import analytics data πŸ”— πŸ“„
  • Migrate from Amazon Redshift πŸ†•: Migrate from Redshift to BigQuery πŸ”—
  • Migrate from Teradata πŸ†•: Migrate from Teradata to BigQuery πŸ”—
  • Migrate for Anthos πŸ†•: Migrate VMs to GKE containers πŸ”— πŸ“„
  • Migrate for Compute Engine: Compute Engine migration tools πŸ”— πŸ“„
  • VM Migration: VM migration tools πŸ”—

API Platform and Ecosystems

  • API Analytics: API metrics πŸ”—
  • API Monetization: Monetize APIs πŸ”—
  • Apigee API Platform: Develop, secure, monitor APIs πŸ”—
  • Apigee Sense: API protection from attacks πŸ”—
  • Apigee Hybrid πŸ†•: Manage hybrid/multi-cloud API environments πŸ”—πŸ“„
  • Cloud Endpoints: Cloud API gateway πŸ”—
  • Cloud Healthcare API: Healthcare system GCP interoperability πŸ”—
  • Developer Portal: API management portal πŸ”—
  • GCP Marketplace: Partner & open source marketplace πŸ”—

Google Maps Platform

  • Directions API: Get directions between locations πŸ”—
  • Distance Matrix API: Calculate travel times πŸ”—
  • Geocoding API: Convert address to/from coordinates πŸ”—
  • Geolocation API: Derive location without GPS πŸ”—
  • Maps Embed API: Web embedded maps πŸ”—
  • Maps JavaScript API: Dynamic web maps πŸ”—
  • Maps SDK for Android: Maps SDK for Android πŸ”—
  • Maps SDK for iOS: Maps SDK for iOS πŸ”—
  • Maps Static API: Web static maps πŸ”—
  • Maps Unity SDK: Unity SDK for games πŸ”—
  • Maps URLs: URL scheme for maps πŸ”—
  • Places API: Metadata about places (REST) πŸ”—
  • Places Library, Maps JS API: Metadata about places (JavaScript) πŸ”—
  • Places SDK for Android: Places SDK for Android πŸ”—
  • Places SDK for iOS: Places SDK for iOS πŸ”—
  • Roads API: Metadata about roads πŸ”—
  • Street View Static API: Static street view images πŸ”—
  • Street View Service: Interactive street view images" πŸ”—
  • Time Zone API: Convert coordinates to timezone πŸ”—

G Suite Platform

  • App Maker: Assistive app building πŸ”—
  • Apps Script: Extend and automate everything πŸ”—
  • Editor Add-ons: Extend Docs, Sheets, Slides πŸ”—
  • Gmail Add-ons: Contextual apps in Gmail πŸ”—
  • Hangouts Chat Bots: Conversational bots in chat πŸ”—
  • Calendar API: Create and manage calendars πŸ”—
  • Classroom API: Provision and manage classrooms πŸ”—
  • Docs API: Create and edit documents πŸ”—
  • Drive API: Read and write files πŸ”—
  • Gmail API: Enhance Gmail πŸ”—
  • Sheets API: Read and write spreadsheets πŸ”—
  • Slides API: Create and edit presentations πŸ”—
  • Drive Picker: Drive file selection widget πŸ”—
  • Cloud Search: Unified search for enterprise πŸ”—
  • Admin SDK: Manage G Suite resources πŸ”—
  • Email Markup: Interactive email using schema.org πŸ”—
  • G Suite Marketplace: Storefront for integrated applications πŸ”—
  • Other G Suite APIs/SDKs: Contacts, Google+, Tasks, Vault... πŸ”—

Mobile (Firebase)

  • Cloud Firestore: Document store and sync πŸ”—
  • Cloud Functions for Firebase: Event-driven serverless applications πŸ”—
  • Cloud Storage for Firebase: Object storage and serving πŸ”—
  • Crashlytics: Crash reporting and analytics πŸ”—
  • Firebase A/B Testing: Create A/B test experiments πŸ”—
  • Firebase App Indexing: App/Google search integration πŸ”—
  • Firebase Authentication: Drop-in authentication πŸ”—
  • Firebase Cloud Messaging: Send device notifications πŸ”—
  • Firebase Dynamic Links: Link to app content πŸ”—
  • Firebase Hosting: Web hosting with CDN/SSL πŸ”—
  • Firebase In-App Messaging: Send in-app contextual messages πŸ”—
  • Firebase Performance Monitoring: App performance monitoring πŸ”—
  • Firebase Predictions: Predict user targeting πŸ”—
  • Firebase Realtime Database: Real-time data synchronization πŸ”—
  • Firebase Remote Config: Remotely configure installed apps πŸ”—
  • Firebase Test Lab: Mobile testing device farm πŸ”—
  • Google Analytics for Firebase: Mobile app analytics πŸ”—
  • ML Kit for Firebase: ML APIs for mobile πŸ”—

GCP Foundational Open Source Projects

  • Apache Beam: Batch/streaming data processing πŸ”—
  • gRPC: RPC framework πŸ”—
  • gVisor: Secure container runtime πŸ”—
  • Istio: Connect and secure services πŸ”—
  • Knative: Serverless framework for Kubernetes πŸ”—
  • Kubeflow: ML toolkit for Kubernetes πŸ”—
  • Kubernetes: Management of containerized applications πŸ”—
  • OpenCensus: Cloud native observability framework πŸ”—
  • TensorFlow: ML framework πŸ”—

Additional Resources


Everything below is not included in the PDFs/PNGs due to space limitations


Additional Resources

Platform Comparisons

  • Google Cloud Platform for AWS Professionals:πŸ“„
  • Google Cloud Platform for Azure Professionals:πŸ“„
  • Google Cloud Platform for Data Center Professionals:πŸ“„
  • Google Cloud Platform for OpenStack Users:πŸ“„

Language Specific Documentation

GKE

  Set default region/zone

  gcloud config set compute/region us-central1

  gcloud config set compute/zone us-central1-a

Enable API's

  gcloud services enable container.googleapis.com

  gcloud services enable containerregistry.googleapis.com

Clone github for sample application and browse to directory

git clone https://github.com/linuxacademy/content-gc-essentials

cd content-gc-essentials/gke-lab-01

Package code into Docker container - tag as version 1 ("build it")

docker build -t gcr.io/$DEVSHELL_PROJECT_ID/hello-la:v1 .

Note: the period at the end is required to build it at this location

Check status of images to ensure success

docker images

Authenticate gcloud as a Docker credential helper

gcloud auth configure-docker

Push Docker container into Container Registry

docker push gcr.io/$DEVSHELL_PROJECT_ID/hello-la:v1

Create Kubernetes Engine Cluster (Nodes) named 'hello-cluster'

gcloud container clusters create hello-cluster --num-nodes=2

Authenticate kubectl to point to the cluster we just made (already done for last created cluster)

  gcloud container clusters get-credentials hello-cluster

  Deploy your app ("deploy and run it") - listen on port 80

  kubectl run hello-la --image=gcr.io/$DEVSHELL_PROJECT_ID/hello-la:v1 --port 80

Check out our pods on the nodes

  kubectl get pods

  Create load balancer and expose application to the Internet on port 80

  kubectl expose deployment hello-la --type=LoadBalancer --port 80 --target-port 80

Find our load balancer frontend IP address

  kubectl get service

Scale up deployment - add static number of replicas (pods)

  kubectl scale deployment hello-la --replicas=3

On second thought, let's just autoscale our application instead....

Horizontal Pod Autoscaler

  kubectl autoscale deployment hello-la --max 6 --min 4 --cpu-percent 50

Maybe we should statically resize the node pool/cluster as well?

  gcloud container clusters resize hello-cluster --size 3

If more than one pool per cluster, specify pool with --node-pool (pool_name)

On second thought (again), let's also enable autoscaling for our cluster

  gcloud container clusters update hello-cluster --enable-autoscaling --min-nodes 2 --max-nodes 8

Make changes to source code, then build as Docker file as VERSION 2

  docker build -t gcr.io/$DEVSHELL_PROJECT_ID/hello-la:v2 .

Push to Container Registry, also as version 2

  docker push gcr.io/$DEVSHELL_PROJECT_ID/hello-la:v2

Update our website - Apply rolling update to deployment with image update

  kubectl set image deployment/hello-la hello-la=gcr.io/$DEVSHELL_PROJECT_ID/hello-la:v2

Get log info

Logs are written to pods, by default also written to Stackdriver Logging

View log on pod

  kubectl logs (POD_ID)

Other commands/scenarios

Upgrade version of Kubernetes on cluster

  gcloud containers clusters upgrade (cluster_name)

BILLING >>>> Storing on BIGQUERY

You can capture and save your date on S3 and also Bigquery where you can also do some analytics if you want.

CAPTURE BILLING DATA FROM BIGQUERY and Few more examples for Billing Report.

SELECT *  
FROM `cloud-training-prod-bucket.arch_infra.billing_data`

Highest cost First

SELECT *  
FROM `cloud-training-prod-bucket.arch_infra.billing_data`
ORDER BY cost DESC

Specific COST

 SELECT product, resource_type, start_time, end_time,  
 cost, project_id, project_name, project_labels_key, currency, currency_conversion_rate,
 usage_amount, usage_unit
 FROM `cloud-training-prod-bucket.arch_infra.billing_data`
 WHERE (cost > 3)  

note here "3" is cost

Next let’s find which product had the highest total number of records:

SELECT product, COUNT(*)
FROM `cloud-training-prod-bucket.arch_infra.billing_data`
GROUP BY product
LIMIT 200

let’s see which product most frequently cost more than a dollar:

SELECT product, cost, COUNT(*)
FROM `cloud-training-prod-bucket.arch_infra.billing_data`
WHERE (cost > 1)
GROUP BY cost, product
LIMIT 200

CLOUD STORAGE >>>>>>>>>>>>>>>>>>>

Assiging Access

Assign IAM roles to buckets:

    gsutil iam ch user:(user_email):(role1,role2) gs://(BUCKET)

Remove IAM role from bucket:

    gsutil iam ch -d user:(user_email):(role1,role2) gs://(BUCKET)

Remove all roles from bucket for given user:

    gsutil iam ch -d user:(user_email) gs://(BUCKET)

Assign ACL roles to buckets and objects:

    gsutil acl ch -u (user_email):(O/R/W) gs://(BUCKET)

Delete all ACLs:

    gsutil acl ch -d (user_email) gs://(BUCKET)

Signed URLs

Create service account with key

    Upload to cloud shell (or add to current CLI environment)
    gsutil signurl -d (time_period (10m)) (keyfile.json) gs://(BUCKET)/(object)

Check current versioning policy:

    gsutil versioning get gs://<BUCKET>

Enable Object Versioning:

    gsutil versioning set on gs://<BUCKET>

Check full object details in bucket:

    gsutil ls -a gs://<BUCKET>

Download current lifecycle policy to local machine to edit:

    gsutil lifecycle get gs://<BUCKET> > filename.json

Set new lifecycle policy after making above edits:

    gsutil lifecycle set filename.json gs://<BUCKET>

DISK MANAGEMENT >>>>>>>>>>>

Create disk:

gcloud compute disks create <DISK_NAME> --type=<DISK_TYPE> --size=<SIZE> --zone=<ZONE>

Resize disk:

gcloud compute disks resize <disk_name> --size=<size> --zone=<zone>

Attach disk:

gcloud compute instances attach-disk <instance> --disk=<disk_name> --zone=<zone>

Formatting and Mounting DISK for LINUX in GCP >>>>>>

View available disks:

sudo lsblk

Format attached disk:

sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/sdb

Create mount directory:

sudo mkdir -p /mnt/disks/disk2

Mount disk:

sudo mount -o discard,defaults /dev/sdb /mnt/disks/disk2

Set read/write permissions:

sudo chmod a+w /mnt/disks/
Resize existing Linux disk

Identify the disk to resize:

sudo lsblk

Resize (grow) the partition:

sudo growpart /dev/sda 1

Extend file system to use added space:

sudo resize2fs /dev/sda1

Verify file system is resized:

df -h 

VIRTUAL MACHINE IMAGE MANAGEMENT ->>>>>>>>>

Create image via command line:

gcloud compute images create <image_name> --source-disk <disk_name> --source-disk-zone <zone> --family <image_family>

View image family info:

gcloud compute images describe-from-family <image_family>

Deprecate/set active image version:

gcloud compute images deprecate <image_name> --state <STATE>

Delete image:

gcloud compute images delete <image_name>

STACK DRIVER >>>>>>>>>>>>>>>>>>>>

gcp's People

Contributors

aslamlatheef avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.